diff mbox series

f2fs: init dirty_secmap incorrectly

Message ID 20201130073719.8982-1-jack.qiu@huawei.com
State Accepted
Commit 5335bfc6eb688344bfcd4b4133c002c0ae0d0719
Headers show
Series f2fs: init dirty_secmap incorrectly | expand

Commit Message

Jack Qiu Nov. 30, 2020, 7:37 a.m. UTC
section is dirty, but dirty_secmap may not set

Reported-by: Jia Yang <jiayang5@huawei.com>
Fixes: da52f8ade40b ("f2fs: get the right gc victim section when section
has several segments")

Signed-off-by: Jack Qiu <jack.qiu@huawei.com>
---
v2:
 - cc stable mailing list
 fs/f2fs/segment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.17.1
diff mbox series

Patch

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 1596502f7375..f2a4265318f5 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -4544,7 +4544,7 @@  static void init_dirty_segmap(struct f2fs_sb_info *sbi)
 		return;

 	mutex_lock(&dirty_i->seglist_lock);
-	for (segno = 0; segno < MAIN_SECS(sbi); segno += blks_per_sec) {
+	for (segno = 0; segno < MAIN_SEGS(sbi); segno += sbi->segs_per_sec) {
 		valid_blocks = get_valid_blocks(sbi, segno, true);
 		secno = GET_SEC_FROM_SEG(sbi, segno);