From: Chao Yu Date: Tue, 13 May 2025 03:19:07 +0000 (+0800) Subject: f2fs: add f2fs_bug_on() in f2fs_quota_read() X-Git-Tag: v6.16-rc1~115^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5827e3c720e5a881bf97451e3c280445f67cba04;p=thirdparty%2Flinux.git 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 Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index bd37139d0d9e3..7654f2beabdde 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2734,6 +2734,12 @@ repeat: goto repeat; } + /* + * should never happen, just leave f2fs_bug_on() here to catch + * any potential bug. + */ + f2fs_bug_on(F2FS_SB(sb), !folio_test_uptodate(folio)); + memcpy_from_folio(data, folio, offset, tocopy); f2fs_folio_put(folio, true);