f2fs: add f2fs_bug_on() in f2fs_quota_read()
Chao Yu
maintainerPATCH v2 2/2 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 <[email protected]>
---
v2:
- just add f2fs_bug_on(), get rid of error handling.
fs/f2fs/super.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/f2fs/super.c +6 -0
@@ -2973,6 +2973,12 @@ static ssize_t f2fs_quota_read(struct super_block *sb, int type, char *data, goto repeat; } +/* +* should never happen, just leave f2fs_bug_on() here to catch +* any potential bug. +*/ +f2fs_bug_on (sbi, !folio_test_uptodate (folio)); +memcpy_from_folio (data, folio, offset, tocopy);f2fs_folio_put (folio, true);
Signature · 1 line
2.49.0
Jaegeuk Kim
maintainerQuoted 16 lines · Chao Yu
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 <[email protected]>---
v2:
- just addf2fs_bug_on(), get rid of error handling.fs/f2fs/super.c | 6 ++++++ 1 file changed, 6 insertions(+)fs/f2fs/super.c +0
-0
fs/f2fs/super.c static ssize_t f2fs_quota_read(struct super_block *sb, int type, char *data, · line 2980
Quoted 8 lines
fs/f2fs/super.c +5
-0@@ -2973,6 +2973,12 @@ static ssize_t f2fs_quota_read(struct super_block *sb, int type, char *data, goto repeat; } +/* +* should never happen, just leave f2fs_bug_on() here to catch +* any potential bug. +*/ +f2fs_bug_on (sbi, !folio_test_uptodate (folio));
Applied with F2FS_SB(sb)
Quoted 6 lines
fs/f2fs/super.c +1
-0+memcpy_from_folio (data, folio, offset, tocopy);f2fs_folio_put (folio, true);Signature · 1 line
2.49.0