diff mbox

[BUG] :bad unlock balance detected!

Message ID 20131105021216.GA15974@localhost.localdomain (mailing list archive)
State New, archived
Headers show

Commit Message

Liu Bo Nov. 5, 2013, 2:12 a.m. UTC
Hi,

Would you please try the following patch?

-liubo

From: Liu Bo <bo.li.liu@oracle.com>
Subject: [PATCH] Btrfs: fix to use the right trans for async commit

@trans has been freed and is undefined, and we should use the trans
handle created for async commit instead.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
 fs/btrfs/transaction.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

 			1, _THIS_IP_);

Comments

Miao Xie Nov. 5, 2013, 2:31 a.m. UTC | #1
On 	tue, 5 Nov 2013 10:12:17 +0800, Liu Bo wrote:
> Hi,
> 
> Would you please try the following patch?
> 
> -liubo
> 
> From: Liu Bo <bo.li.liu@oracle.com>
> Subject: [PATCH] Btrfs: fix to use the right trans for async commit
> 
> @trans has been freed and is undefined, and we should use the trans
> handle created for async commit instead.
> 
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
> ---
>  fs/btrfs/transaction.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
> index 8c81bdc..648d839 100644
> --- a/fs/btrfs/transaction.c
> +++ b/fs/btrfs/transaction.c
> @@ -1494,7 +1494,7 @@ int btrfs_commit_transaction_async(struct
> btrfs_trans_handle *trans,
>  	 * Tell lockdep we've released the freeze rwsem, since the
>  	 * async commit thread will be the one to unlock it.
>  	 */
> -	if (trans->type < TRANS_JOIN_NOLOCK)
> +	if (ac->newtrans->type < TRANS_JOIN_NOLOCK)

It should be:

if (trans->type & __TRANS_FREEZABLE)

The same for

do_async_commit()

>  		rwsem_release(
>  			&root->fs_info->sb->s_writers.lock_map[SB_FREEZE_FS-1],
>  			1, _THIS_IP_);
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 8c81bdc..648d839 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -1494,7 +1494,7 @@  int btrfs_commit_transaction_async(struct
btrfs_trans_handle *trans,
 	 * Tell lockdep we've released the freeze rwsem, since the
 	 * async commit thread will be the one to unlock it.
 	 */
-	if (trans->type < TRANS_JOIN_NOLOCK)
+	if (ac->newtrans->type < TRANS_JOIN_NOLOCK)
 		rwsem_release(
 			&root->fs_info->sb->s_writers.lock_map[SB_FREEZE_FS-1],