Commit 38e88054 authored by Sage Weil's avatar Sage Weil Committed by Chris Mason

Btrfs: clear current->journal_info on async transaction commit

Normally current->jouranl_info is cleared by commit_transaction.  For an
async snap or subvol creation, though, it runs in a work queue.  Clear
it in btrfs_commit_transaction_async() to avoid leaking a non-NULL
journal_info when we return to userspace.  When the actual commit runs in
the other thread it won't care that it's current->journal_info is already
NULL.
Signed-off-by: default avatarSage Weil <sage@newdream.net>
Tested-by: default avatarJim Schutt <jaschut@sandia.gov>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 38e87880
...@@ -1118,8 +1118,11 @@ int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans, ...@@ -1118,8 +1118,11 @@ int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans,
wait_current_trans_commit_start_and_unblock(root, cur_trans); wait_current_trans_commit_start_and_unblock(root, cur_trans);
else else
wait_current_trans_commit_start(root, cur_trans); wait_current_trans_commit_start(root, cur_trans);
put_transaction(cur_trans);
if (current->journal_info == trans)
current->journal_info = NULL;
put_transaction(cur_trans);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment