Commit 8974b032 authored by Jeff Mahoney's avatar Jeff Mahoney Committed by Greg Kroah-Hartman

btrfs: fix missing error return in btrfs_drop_snapshot

commit e19182c0 upstream.

If btrfs_del_root fails in btrfs_drop_snapshot, we'll pick up the
error but then return 0 anyway due to mixing err and ret.

Fixes: 79787eaa ("btrfs: replace many BUG_ONs with proper error handling")
Signed-off-by: default avatarJeff Mahoney <jeffm@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9cf0eaf8
...@@ -9362,6 +9362,7 @@ int btrfs_drop_snapshot(struct btrfs_root *root, ...@@ -9362,6 +9362,7 @@ int btrfs_drop_snapshot(struct btrfs_root *root,
ret = btrfs_del_root(trans, tree_root, &root->root_key); ret = btrfs_del_root(trans, tree_root, &root->root_key);
if (ret) { if (ret) {
btrfs_abort_transaction(trans, ret); btrfs_abort_transaction(trans, ret);
err = ret;
goto out_end_trans; goto out_end_trans;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment