linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH v3 0/2] f2fs: Check write pointers of zoned block devices
@ 2019-11-14  8:19 Shin'ichiro Kawasaki
  2019-11-14  8:19 ` [f2fs-dev] [PATCH v3 1/2] f2fs: Check write pointer consistency of open zones Shin'ichiro Kawasaki
  2019-11-14  8:19 ` [f2fs-dev] [PATCH v3 2/2] f2fs: Check write pointer consistency of non-open zones Shin'ichiro Kawasaki
  0 siblings, 2 replies; 14+ messages in thread
From: Shin'ichiro Kawasaki @ 2019-11-14  8:19 UTC (permalink / raw)
  To: Jaegeuk Kim, Chao Yu, linux-f2fs-devel; +Cc: Damien Le Moal

On sudden f2fs shutdown, zoned block device status and f2fs meta data can be
inconsistent. When f2fs shutdown happens during write operations, write pointers
on the device go forward but the f2fs meta data does not reflect the write
pointer progress. This inconsistency will eventually cause "Unaligned write
command" error when restarting write operation after the next mount.

This error is observed with xfstests test case generic/388, which enforces
sudden shutdown during write operation and checks the file system recovery.

This patch series adds a feature to f2fs to check and fix the write pointer
consistency when zoned block devices get mounted. Per discussion on the list,
implement two checks: a check for open zones and a check for non-open zones.

The first patch add the check for open zones that current segments point to.
Check write pointer consistency with current segment positions recorded in CP,
and if they are inconsistent, assign a new zone to the current segment. When
fsync data exists, check and fix the consistency after fsync data recovery.

The second patch adds the check for non-open zones that current segments do not
point to. Compare write pointers with valid block maps in SIT, and if they are
inconsistent, report the failure. Even if fixes are required, do not have kernel
fix because SIT consistency with CP is not guaranteed because of hardware
failure or software bug possibility. In such check failure cases, fail the mount
to ask users to run fsck. Corresponding patch series is being posted for
fsck.f2fs to add the write pointer consistency check feature.

Thank goes to Chao Yu for the detailed discussion on the list.

Changes from v2:
* 1st patch: Fix write pointer in SBI_POR_DOING guard
             Removed __set_inuse() and f2fs_stop_checkpoint()
* 2nd patch: Reversed bitmap search and removed __set_inuse()
             Changed condition for disable_roll_forward/norecovery mount options

Changes from v1:
* 2nd patch: Added check to ensure zones are in main segments

Shin'ichiro Kawasaki (2):
  f2fs: Check write pointer consistency of open zones
  f2fs: Check write pointer consistency of non-open zones

 fs/f2fs/f2fs.h     |   4 +
 fs/f2fs/recovery.c |  17 ++-
 fs/f2fs/segment.c  | 269 +++++++++++++++++++++++++++++++++++++++++++++
 fs/f2fs/super.c    |  16 ++-
 4 files changed, 301 insertions(+), 5 deletions(-)

-- 
2.23.0



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2019-12-02  9:51 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-14  8:19 [f2fs-dev] [PATCH v3 0/2] f2fs: Check write pointers of zoned block devices Shin'ichiro Kawasaki
2019-11-14  8:19 ` [f2fs-dev] [PATCH v3 1/2] f2fs: Check write pointer consistency of open zones Shin'ichiro Kawasaki
2019-11-25  6:59   ` Chao Yu
2019-11-28  4:07     ` Shinichiro Kawasaki
2019-11-28 12:26       ` Chao Yu
2019-11-29  1:58         ` Shinichiro Kawasaki
2019-11-14  8:19 ` [f2fs-dev] [PATCH v3 2/2] f2fs: Check write pointer consistency of non-open zones Shin'ichiro Kawasaki
2019-11-25  7:37   ` Chao Yu
2019-11-28  5:31     ` Shinichiro Kawasaki
2019-11-28 12:39       ` Chao Yu
2019-11-29  5:21         ` Shinichiro Kawasaki
2019-11-30  7:49           ` Chao Yu
2019-12-02  1:38             ` Shinichiro Kawasaki
2019-12-02  9:51               ` Shinichiro Kawasaki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).