diff options
author | Chao Yu <yuchao0@huawei.com> | 2020-03-21 15:24:11 +0300 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2020-03-31 06:46:24 +0300 |
commit | 23c51bed6f5d21aeebeaf9cdcd63ac3d3cbd0f83 (patch) | |
tree | 9545608d7c28e959637654e04d0a3a7f7548cf25 /fs/f2fs | |
parent | d76af0d675d4733c24a848e62d263a362aefa925 (diff) | |
download | linux-23c51bed6f5d21aeebeaf9cdcd63ac3d3cbd0f83.tar.xz |
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 fb7d70db305a ("f2fs: clear PageError on the read path").
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/compress.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index 00fd6f904139..d66d372d104d 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -1187,15 +1187,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); } } |