Skip to content

Commit 23c51be

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: fix to clear PG_error if fsverity failed
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 fb7d70d ("f2fs: clear PageError on the read path"). Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent d76af0d commit 23c51be

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

fs/f2fs/compress.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,15 +1187,17 @@ void f2fs_decompress_end_io(struct page **rpages,
11871187
if (!rpage)
11881188
continue;
11891189

1190-
if (err || PageError(rpage)) {
1191-
ClearPageUptodate(rpage);
1192-
ClearPageError(rpage);
1193-
} else {
1194-
if (!verity || fsverity_verify_page(rpage))
1195-
SetPageUptodate(rpage);
1196-
else
1197-
SetPageError(rpage);
1190+
if (err || PageError(rpage))
1191+
goto clear_uptodate;
1192+
1193+
if (!verity || fsverity_verify_page(rpage)) {
1194+
SetPageUptodate(rpage);
1195+
goto unlock;
11981196
}
1197+
clear_uptodate:
1198+
ClearPageUptodate(rpage);
1199+
ClearPageError(rpage);
1200+
unlock:
11991201
unlock_page(rpage);
12001202
}
12011203
}

0 commit comments

Comments
 (0)