diff options
author | Filipe Manana <fdmanana@suse.com> | 2022-02-03 18:36:43 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-03-14 15:13:50 +0300 |
commit | bbf0ea7ea3855b35a2ab0b8d0000ce06cc58e4bf (patch) | |
tree | cffabc7196ceb02f3573c08abf0f581e8d6ed80d /fs/btrfs/extent_io.c | |
parent | c03475506e3e7fed2c428a953f1fcc01c04aabd5 (diff) | |
download | linux-bbf0ea7ea3855b35a2ab0b8d0000ce06cc58e4bf.tar.xz |
btrfs: fix lost error return value when reading a data page
At btrfs_do_readpage(), if we get an error when trying to lookup for an
extent map, we end up marking the page with the error bit, clearing
the uptodate bit on it, and doing everything else that should be done.
However we return success (0) to the caller, when we should return the
error encoded in the extent map pointer. So fix that by returning the
error encoded in the pointer.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r-- | fs/btrfs/extent_io.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 37589fd440b5..8b6e9ca3170a 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -3611,6 +3611,7 @@ int btrfs_do_readpage(struct page *page, struct extent_map **em_cached, if (IS_ERR(em)) { unlock_extent(tree, cur, end); end_page_read(page, false, cur, end + 1 - cur); + ret = PTR_ERR(em); break; } extent_offset = cur - em->start; |