]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: deal with errors when replaying dir entry during log replay
authorFilipe Manana <fdmanana@suse.com>
Fri, 1 Oct 2021 12:52:31 +0000 (13:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Oct 2021 09:40:13 +0000 (11:40 +0200)
commit3513ba8df84c98704d505e21f0a8d505a6ead72c
tree9f290dbea69feb20f22984541cb477b47e3ec6a9
parent8d400cc2e6d8ab6c88b226f81eee2aebb291ecc1
btrfs: deal with errors when replaying dir entry during log replay

commit 87cb69a822b3555ea7230e2873ff79252f1c4d0f upstream.

At replay_one_one(), we are 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