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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Dec 2017 08:52:54 +0000 (09:52 +0100)
commit85ab61fdfa4866cd0465c75fb97a0601fed9973d
tree02af53985f3641a222e40986d792a0bcd8466b75
parent58582f04bc87b9d8d848d9163ce3355dd6f00602
btrfs: fix missing error return in btrfs_drop_snapshot

commit e19182c0fff451e3744c1107d98f072e7ca377a0 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: 79787eaab4612 ("btrfs: replace many BUG_ONs with proper error handling")
Signed-off-by: Jeff Mahoney <jeffm@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/extent-tree.c