From 98dc08bae6780bb950b5c0cdefeb662b22482655 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Mon, 28 Nov 2022 23:04:01 -0800 Subject: fsverity: stop using PG_error to track error status As a step towards freeing the PG_error flag for other uses, change ext4 and f2fs to stop using PG_error to track verity errors. Instead, if a verity error occurs, just mark the whole bio as failed. The coarser granularity isn't really a problem since it isn't any worse than what the block layer provides, and errors from a multi-page readahead aren't reported to applications unless a single-page read fails too. f2fs supports compression, which makes the f2fs changes a bit more complicated than desired, but the basic premise still works. Note: there are still a few uses of PageError in f2fs, but they are on the write path, so they are unrelated and this patch doesn't touch them. Reviewed-by: Chao Yu Acked-by: Jaegeuk Kim Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20221129070401.156114-1-ebiggers@kernel.org --- fs/ext4/readpage.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'fs/ext4') diff --git a/fs/ext4/readpage.c b/fs/ext4/readpage.c index 3d21eae267fc..e604ea4e102b 100644 --- a/fs/ext4/readpage.c +++ b/fs/ext4/readpage.c @@ -75,14 +75,10 @@ static void __read_end_io(struct bio *bio) bio_for_each_segment_all(bv, bio, iter_all) { page = bv->bv_page; - /* PG_error was set if verity failed. */ - if (bio->bi_status || PageError(page)) { + if (bio->bi_status) ClearPageUptodate(page); - /* will re-read again later */ - ClearPageError(page); - } else { + else SetPageUptodate(page); - } unlock_page(page); } if (bio->bi_private) -- cgit v1.2.3