From: Jeff Mahoney Date: Mon, 4 Dec 2017 18:11:45 +0000 (-0500) Subject: btrfs: fix missing error return in btrfs_drop_snapshot X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=85ab61fdfa4866cd0465c75fb97a0601fed9973d;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index e4774c02d922..d227d8514b25 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -9283,6 +9283,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; }