]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: deal with errors when adding inode reference during log replay
authorFilipe Manana <fdmanana@suse.com>
Fri, 1 Oct 2021 12:52:32 +0000 (13:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Oct 2021 09:40:13 +0000 (11:40 +0200)
commit9f6cf986d5e0f29e28f60c86439f3690a493a3cc
treea34925d707926728fbef152caeb18afd3861257a
parent6f23ecb2ccb18da062d78e068fd75efa5f2d65c1
btrfs: deal with errors when adding inode reference during log replay

commit 52db77791fe24538c8aa2a183248399715f6b380 upstream.

At __inode_add_ref(), we treating any error returned from
btrfs_lookup_dir_item() or from btrfs_lookup_dir_index_item() as meaning
that there is no existing directory entry in the fs/subvolume tree.
This is not correct since we can get errors such as, for example, -EIO
when reading extent buffers while searching the fs/subvolume's btree.

So fix that and return the error to the caller when it is not -ENOENT.

CC: stable@vger.kernel.org # 4.14+
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/tree-log.c