On 2019/9/18 11:07, Shinichiro Kawasaki wrote: > Thanks for the comments. I read f2fs code further, and think still the > SIT vs write pointer check can be implemented and meaningful. > > F2fs ensures consistency of SIT using two CP areas, two SIT areas and > sit_bitmap in CP. These metadata are in the conventional zone that not > affected by write pointer control logic. My current scope is to ensure > write pointer control logic correctness for zoned block device. From this > scope and the f2fs SIT consistency feature, I would like to assume that > SIT entries built in kernel after f2fs mount is correct for the write > pointer position check.
SIT may be broken due to software bug or hardware flaw, we'd better not consider it as a consistent metadata. > > Fsck does additional SIT consistency check in fsck_chk_meta(). It would be > good to do the write pointer position check at the end of fsck_chk_meta(). SIT can be changed later? e.g. SIT bitmap says one block address is valid, however fsck found there is no entry can link to it, then it needs to be deleted? it may affect write_pointer repair, right? So we'd better look into all SIT update cases in fsck. > >> - need to consider fsynced block in SIT > > As far as I read fsync logic, fsync results in do_write_page() call which > does both of SIT entry update and write bio submit. In other words, SIT > update and write pointer move are expected for fsync also. Then I think > the write pointer consistency check with last valid block obtained from > SIT is meaningful, when I take fsynced blocks into account. Yup, :) Thanks, _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel