summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/transaction.c
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2014-06-12 07:53:44 +0200
committerChris Mason <clm@fb.com>2014-06-13 18:52:30 +0200
commit47a306a74842248dcd537b85f9a36c7b156c59a9 (patch)
treea0fdc3fdfd02c3804777a7322275529919f3564e /fs/btrfs/transaction.c
parentbtrfs: fix use of uninit "ret" in end_extent_writepage() (diff)
downloadlinux-47a306a74842248dcd537b85f9a36c7b156c59a9.tar.xz
linux-47a306a74842248dcd537b85f9a36c7b156c59a9.zip
btrfs: fix error handling in create_pending_snapshot
fcebe456 cut and pasted some code to a later point in create_pending_snapshot(), but didn't switch to the appropriate error handling for this stage of the function. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to '')
-rw-r--r--fs/btrfs/transaction.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 9630f10f8e1e..511839c04f11 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -1284,11 +1284,13 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
goto fail;
}
- pending->error = btrfs_qgroup_inherit(trans, fs_info,
- root->root_key.objectid,
- objectid, pending->inherit);
- if (pending->error)
- goto no_free_objectid;
+ ret = btrfs_qgroup_inherit(trans, fs_info,
+ root->root_key.objectid,
+ objectid, pending->inherit);
+ if (ret) {
+ btrfs_abort_transaction(trans, root, ret);
+ goto fail;
+ }
/* see comments in should_cow_block() */
set_bit(BTRFS_ROOT_FORCE_COW, &root->state);