diff mbox series

[f2fs-dev] f2fs-tools: fix wrong write pointer check for non-zoned areas

Message ID 20230606173948.3390215-1-daeho43@gmail.com (mailing list archive)
State New
Headers show
Series [f2fs-dev] f2fs-tools: fix wrong write pointer check for non-zoned areas | expand

Commit Message

Daeho Jeong June 6, 2023, 5:39 p.m. UTC
From: Daeho Jeong <daehojeong@google.com>

Do not check F2FS_ZONED_HM for the whole device. We need to do this for
each area of devices.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
---
 fsck/mount.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Chao Yu June 8, 2023, 10:11 a.m. UTC | #1
On 2023/6/7 1:39, Daeho Jeong wrote:
> From: Daeho Jeong <daehojeong@google.com>
> 
> Do not check F2FS_ZONED_HM for the whole device. We need to do this for
> each area of devices.
> 
> Signed-off-by: Daeho Jeong <daehojeong@google.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,
diff mbox series

Patch

diff --git a/fsck/mount.c b/fsck/mount.c
index 851a62b..0ebbfcf 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -2868,9 +2868,6 @@  static bool write_pointer_at_zone_start(struct f2fs_sb_info *sbi,
 	int log_sectors_per_block = sbi->log_blocksize - SECTOR_SHIFT;
 	int ret, j;
 
-	if (c.zoned_model != F2FS_ZONED_HM)
-		return true;
-
 	for (j = 0; j < MAX_DEVICES; j++) {
 		if (!c.devices[j].path)
 			break;
@@ -2882,6 +2879,9 @@  static bool write_pointer_at_zone_start(struct f2fs_sb_info *sbi,
 	if (j >= MAX_DEVICES)
 		return false;
 
+	if (c.devices[j].zoned_model != F2FS_ZONED_HM)
+		return true;
+
 	sector = (block - c.devices[j].start_blkaddr) << log_sectors_per_block;
 	ret = f2fs_report_zone(j, sector, &blkz);
 	if (ret)