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, 28 Feb 2022 15:19:51 +0000 (16:19 +0100)
commit7f7a202dd6e2d107330f309422e90f4e2cf782ef
treee6756ddbc0646229aea643687547d125b2b32fe7
parent4cdd7aec054e45cffee5d55465ac8f494b69d3f5
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