Skip to content

Commit 47a306a

Browse files
Eric Sandeenmasoncl
authored andcommitted
btrfs: fix error handling in create_pending_snapshot
fcebe45 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 <[email protected]> Signed-off-by: Chris Mason <[email protected]>
1 parent 3e2426b commit 47a306a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

fs/btrfs/transaction.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,11 +1284,13 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
12841284
goto fail;
12851285
}
12861286

1287-
pending->error = btrfs_qgroup_inherit(trans, fs_info,
1288-
root->root_key.objectid,
1289-
objectid, pending->inherit);
1290-
if (pending->error)
1291-
goto no_free_objectid;
1287+
ret = btrfs_qgroup_inherit(trans, fs_info,
1288+
root->root_key.objectid,
1289+
objectid, pending->inherit);
1290+
if (ret) {
1291+
btrfs_abort_transaction(trans, root, ret);
1292+
goto fail;
1293+
}
12921294

12931295
/* see comments in should_cow_block() */
12941296
set_bit(BTRFS_ROOT_FORCE_COW, &root->state);

0 commit comments

Comments
 (0)