From: Jeff Mahoney jeffm@suse.com
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 --- fs/btrfs/extent-tree.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 4497f937e8fb..2f4328511ac8 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -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; }
On Mon, Dec 04, 2017 at 01:11:45PM -0500, jeffm@suse.com wrote:
From: Jeff Mahoney jeffm@suse.com
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
linux-stable-mirror@lists.linaro.org