btrfs: fix lost error return value when reading a data page
authorFilipe Manana <fdmanana@suse.com>
Thu, 3 Feb 2022 15:36:43 +0000 (15:36 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 14 Feb 2022 15:36:03 +0000 (16:36 +0100)
commit1ef88557e5a2dd84d65a1b285ca4274fa509f034
tree9096b54b7ea33297021c3211ec26366aad59394d
parent30c37c77db3b187400660b6448d009eb45e4d136
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>
fs/btrfs/extent_io.c
fs/btrfs/inode.c