]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
btrfs: fix missing error return in btrfs_drop_snapshot
authorJeff Mahoney <jeffm@suse.com>
Mon, 4 Dec 2017 18:11:45 +0000 (13:11 -0500)
committerDavid Sterba <dsterba@suse.com>
Wed, 6 Dec 2017 23:30:29 +0000 (00:30 +0100)
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: 79787eaab4612 ("btrfs: replace many BUG_ONs with proper error handling")
Cc: <stable@vger.kernel.org> # v3.4+
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c

index 784d41e95ed9534b1f120d3e4895e9d4b8da38e3..16e46ee3cd16a923d53338675cae7c4d93d5d7c9 100644 (file)
@@ -9220,6 +9220,7 @@ int btrfs_drop_snapshot(struct btrfs_root *root,
        ret = btrfs_del_root(trans, fs_info, &root->root_key);
        if (ret) {
                btrfs_abort_transaction(trans, ret);
+               err = ret;
                goto out_end_trans;
        }