]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
btrfs: stop checking for -EEXIST return value from btrfs_uuid_tree_add()
authorFilipe Manana <fdmanana@suse.com>
Tue, 24 Feb 2026 15:13:32 +0000 (15:13 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 7 Apr 2026 16:55:59 +0000 (18:55 +0200)
commit7aa1788ff09fba1db7d66b38a20051f0997b9cb9
tree8bc0d4b79e961050eda8fdc77abd42766861f605
parentf11c3d855988ce16da14a416832d0b876f44eece
btrfs: stop checking for -EEXIST return value from btrfs_uuid_tree_add()

We never return -EEXIST from btrfs_uuid_tree_add(), if the item already
exists we extend it, so it's pointless to check for such return value.

Furthermore, in create_pending_snapshot(), the logic is completely broken.
The goal was to not error out and abort the transaction in case of -EEXIST
but we left 'ret' with the -EEXIST value, so we end up setting
pending->error to -EEXIST and return that error up the call chain up to
btrfs_commit_transaction(), which will abort the transaction.

Reviewed-by: Boris Burkov <boris@bur.io>
Reviewed-by: Qu Wenruo <wqu@suse.com>
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/ioctl.c
fs/btrfs/transaction.c