]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: fix lost error handling when looking up extended ref on log replay
authorFilipe Manana <fdmanana@suse.com>
Mon, 1 Aug 2022 13:57:51 +0000 (14:57 +0100)
committerDavid Sterba <dsterba@suse.com>
Wed, 17 Aug 2022 14:19:45 +0000 (16:19 +0200)
commitcd153f0d80b7eae17144f0f2a62a76344a160d45
tree7f669910ad2fe09b667a01532b91f12ddc6fd89e
parenta17af50e08fe021b47e876f5d4d25e54354f14f4
btrfs: fix lost error handling when looking up extended ref on log replay

During log replay, when processing inode references, if we get an error
when looking up for an extended reference at __add_inode_ref(), we ignore
it and proceed, returning success (0) if no other error happens after the
lookup. This is obviously wrong because in case an extended reference
exists and it encodes some name not in the log, we need to unlink it,
otherwise the filesystem state will not match the state it had after the
last fsync.

So just make __add_inode_ref() return an error it gets from the extended
reference lookup.

Fixes: 0a9f7522679efa ("btrfs: extended inode refs")
CC: stable@vger.kernel.org # 4.9+
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tree-log.c