linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs: update cur_valid_map_mir together with cur_valid_map
@ 2017-08-01  7:56 Yunlong Song
  2017-08-01 15:44 ` Chao Yu
  2017-08-02 13:20 ` [PATCH v2] " Yunlong Song
  0 siblings, 2 replies; 9+ messages in thread
From: Yunlong Song @ 2017-08-01  7:56 UTC (permalink / raw)
  To: jaegeuk, chao, yuchao0, sylinux, yunlong.song
  Cc: miaoxie, bintian.wang, linux-fsdevel, linux-f2fs-devel,
	linux-kernel

When cur_valid_map passes the f2fs_test_and_set(,clear)_bit test,
cur_valid_map_mir update is skipped unlikely, so fix it.

Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
---
 fs/f2fs/segment.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 151968e..6f7731a 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1535,6 +1535,10 @@ static void update_sit_entry(struct f2fs_sb_info *sbi, block_t blkaddr, int del)
 			f2fs_bug_on(sbi, 1);
 #endif
 		}
+#ifdef CONFIG_F2FS_CHECK_FS
+		else
+			f2fs_set_bit(offset, se->cur_valid_map_mir);
+#endif
 		if (f2fs_discard_en(sbi) &&
 			!f2fs_test_and_set_bit(offset, se->discard_map))
 			sbi->discard_blks--;
@@ -1556,6 +1560,10 @@ static void update_sit_entry(struct f2fs_sb_info *sbi, block_t blkaddr, int del)
 			f2fs_bug_on(sbi, 1);
 #endif
 		}
+#ifdef CONFIG_F2FS_CHECK_FS
+		else
+			f2fs_clear_bit(offset, se->cur_valid_map_mir);
+#endif
 		if (f2fs_discard_en(sbi) &&
 			f2fs_test_and_clear_bit(offset, se->discard_map))
 			sbi->discard_blks++;
-- 
1.8.5.2

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

end of thread, other threads:[~2017-08-05  1:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-01  7:56 [PATCH] f2fs: update cur_valid_map_mir together with cur_valid_map Yunlong Song
2017-08-01 15:44 ` Chao Yu
     [not found]   ` <c1935af.77af.15d9ebd35e3.Coremail.sylinux@163.com>
2017-08-02  1:34     ` Chao Yu
2017-08-02  8:02       ` Yunlong Song
2017-08-02  8:47         ` Chao Yu
2017-08-02  9:00           ` Yunlong Song
2017-08-02 13:20 ` [PATCH v2] " Yunlong Song
2017-08-02 14:16   ` [PATCH] f2fs: do not change the valid_block value if cur_valid_map was wrongly set or cleared Yunlong Song
2017-08-05  1:23     ` [f2fs-dev] " Chao Yu

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).