Commit 69ce977a authored by Miao Xie's avatar Miao Xie Committed by Chris Mason

Btrfs: output more information when aborting a unused transaction handle

Though we dump the stack information when aborting a unused transaction
handle, we don't know the correct place where we decide to abort the
transaction handle if one function has several place where the transaction
abort function is invoked and jumps to the same place after this call.
And beside that we also don't know the reason why we jump to abort
the current handle. So I modify the transaction abort function and make
it output the function name, line and error information.
Signed-off-by: default avatarMiao Xie <miaox@cn.fujitsu.com>
parent 2ecb7923
...@@ -248,7 +248,13 @@ void __btrfs_abort_transaction(struct btrfs_trans_handle *trans, ...@@ -248,7 +248,13 @@ void __btrfs_abort_transaction(struct btrfs_trans_handle *trans,
/* Nothing used. The other threads that have joined this /* Nothing used. The other threads that have joined this
* transaction may be able to continue. */ * transaction may be able to continue. */
if (!trans->blocks_used) { if (!trans->blocks_used) {
btrfs_printk(root->fs_info, "Aborting unused transaction.\n"); char nbuf[16];
const char *errstr;
errstr = btrfs_decode_error(root->fs_info, errno, nbuf);
btrfs_printk(root->fs_info,
"%s:%d: Aborting unused transaction(%s).\n",
function, line, errstr);
return; return;
} }
trans->transaction->aborted = errno; trans->transaction->aborted = errno;
......
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