mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 16:29:59 +00:00
btrfs: fix fsverify read error handling in end_page_read
[ Upstream commit2c14f0ffdd
] Also clear the uptodate bit to make sure the page isn't seen as uptodate in the page cache if fsverity verification fails. Fixes:146054090b
("btrfs: initial fsverity support") CC: stable@vger.kernel.org # 5.15+ Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
c42d836e2e
commit
693a761758
1 changed files with 2 additions and 6 deletions
|
@ -494,12 +494,8 @@ static void end_page_read(struct page *page, bool uptodate, u64 start, u32 len)
|
|||
ASSERT(page_offset(page) <= start &&
|
||||
start + len <= page_offset(page) + PAGE_SIZE);
|
||||
|
||||
if (uptodate) {
|
||||
if (!btrfs_verify_page(page, start)) {
|
||||
btrfs_page_set_error(fs_info, page, start, len);
|
||||
} else {
|
||||
btrfs_page_set_uptodate(fs_info, page, start, len);
|
||||
}
|
||||
if (uptodate && btrfs_verify_page(page, start)) {
|
||||
btrfs_page_set_uptodate(fs_info, page, start, len);
|
||||
} else {
|
||||
btrfs_page_clear_uptodate(fs_info, page, start, len);
|
||||
btrfs_page_set_error(fs_info, page, start, len);
|
||||
|
|
Loading…
Reference in a new issue