f2fs: add f2fs_bug_on() in f2fs_quota_read()
authorChao Yu <chao@kernel.org>
Tue, 13 May 2025 03:19:07 +0000 (11:19 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 27 May 2025 23:52:35 +0000 (23:52 +0000)
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>
fs/f2fs/super.c

index bd37139..7654f2b 100644 (file)
@@ -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);