Skip to content

Commit 5827e3c

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: add f2fs_bug_on() in f2fs_quota_read()
mapping_read_folio_gfp() will return a folio, it should always be uptodate, let's check folio uptodate status to detect any potenial bug. Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent 9b6fc98 commit 5827e3c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fs/f2fs/super.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2734,6 +2734,12 @@ static ssize_t f2fs_quota_read(struct super_block *sb, int type, char *data,
27342734
goto repeat;
27352735
}
27362736

2737+
/*
2738+
* should never happen, just leave f2fs_bug_on() here to catch
2739+
* any potential bug.
2740+
*/
2741+
f2fs_bug_on(F2FS_SB(sb), !folio_test_uptodate(folio));
2742+
27372743
memcpy_from_folio(data, folio, offset, tocopy);
27382744
f2fs_folio_put(folio, true);
27392745

0 commit comments

Comments
 (0)