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 Mar 2022 12:13:50 +0000 (13:13 +0100)
commitbbf0ea7ea3855b35a2ab0b8d0000ce06cc58e4bf
treecffabc7196ceb02f3573c08abf0f581e8d6ed80d
parentc03475506e3e7fed2c428a953f1fcc01c04aabd5
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