summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChao Yu <chao@kernel.org>2025-05-13 11:19:07 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2025-05-27 23:52:35 +0000
commit5827e3c720e5a881bf97451e3c280445f67cba04 (patch)
tree49124c5beb1196f55789eef7959f2b050b45f707
parent9b6fc9888e03dbe69768ace00091173b169aec39 (diff)
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>
-rw-r--r--fs/f2fs/super.c6
1 files changed, 6 insertions, 0 deletions
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);