Commit 5827e3c7 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim
Browse files

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: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 9b6fc988
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2734,6 +2734,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(F2FS_SB(sb), !folio_test_uptodate(folio));

		memcpy_from_folio(data, folio, offset, tocopy);
		f2fs_folio_put(folio, true);