f2fs: fix to clear PG_error if fsverity failed
Chao Yu
maintainerPATCH 1/1 f2fs: fix to clear PG_error if fsverity failed
From: Chao Yu <[email protected]>
In f2fs_decompress_end_io(), we should clear PG_error flag before page unlock, otherwise reread will fail due to the flag as described in commit fb7d70db305a ("f2fs: clear PageError on the read path").
Signed-off-by Chao Yu <[email protected]>
--- fs/f2fs/compress.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
fs/f2fs/compress.c +10 -8
@@ -1420,15 +1420,17 @@ void f2fs_decompress_end_io(struct page **rpages,if (!rpage)continue ; -if (err ||PageError (rpage)) { -ClearPageUptodate (rpage); -ClearPageError (rpage); - }else { -if (!verity ||fsverity_verify_page (rpage)) -SetPageUptodate (rpage); -else -SetPageError (rpage); +if (err ||PageError (rpage)) + goto clear_uptodate; + +if (!verity ||fsverity_verify_page (rpage)) { +SetPageUptodate (rpage); + goto unlock; } +clear_uptodate: +ClearPageUptodate (rpage); +ClearPageError (rpage); +unlock:unlock_page (rpage); } }
Signature · 1 line
2.22.0