btrfs: fix missing error return in btrfs_drop_snapshot
Subsystems (2)
PATCH 1/1 btrfs: fix missing error return in btrfs_drop_snapshot
From: Jeff Mahoney <[email protected]>
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 <[email protected]> # v3.4+
Signed-off-by Jeff Mahoney <[email protected]>
--- fs/btrfs/extent-tree.c | 1 + 1 file changed, 1 insertion(+)
fs/btrfs/extent-tree.c +1 -0
@@ -9206,6 +9206,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; }
Signature · 1 line
2.14.2
Quoted 8 lines · On Mon, Dec 04, 2017 at 01:11:45PM -0500, [email protected] wrote:
From: Jeff Mahoney <[email protected]>
If
btrfs_del_rootfails inbtrfs_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 <[email protected]> # v3.4+Signed-off-by Jeff Mahoney <[email protected]>
Reviewed-by David Sterba <[email protected]>