From 5827e3c720e5a881bf97451e3c280445f67cba04 Mon Sep 17 00:00:00 2001 From: Chao Yu Date: Tue, 13 May 2025 11:19:07 +0800 Subject: [PATCH] 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 --- fs/f2fs/super.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index bd37139d0d9e..7654f2beabdd 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); -- 2.50.1