All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josef Bacik <josef@redhat.com>
To: Josef Bacik <josef@redhat.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: make sure to unblock the transaction when cleaning it up
Date: Thu, 31 May 2012 14:30:29 -0400	[thread overview]
Message-ID: <20120531183028.GG2080@localhost.localdomain> (raw)
In-Reply-To: <1338477277-5793-1-git-send-email-josef@redhat.com>

On Thu, May 31, 2012 at 11:14:37AM -0400, Josef Bacik wrote:
> When a transaction aborts we can get stuck in places where tasks are waiting
> for the transaction to become unblocked.  So we need to unblock the
> transaction and wake up any waiters so they can exit properly.  Thanks,
> 
> Signed-off-by: Josef Bacik <josef@redhat.com>
> ---
>  fs/btrfs/transaction.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
> index 7aed0e8..1715afb 100644
> --- a/fs/btrfs/transaction.c
> +++ b/fs/btrfs/transaction.c
> @@ -1204,9 +1204,16 @@ static void cleanup_transaction(struct btrfs_trans_handle *trans,
>  	WARN_ON(trans->use_count > 1);
>  
>  	spin_lock(&root->fs_info->trans_lock);
> +	cur_trans->blocked = 0;
>  	list_del_init(&cur_trans->list);
> +	if (root->fs_info->running_transaction == cur_trans) {
> +		root->fs_info->running_transaction = NULL;
> +		root->fs_info->trans_no_join = 0;
> +	}
>  	spin_unlock(&root->fs_info->trans_lock);
>  
> +	wake_up(&root->fs_info->transaction_wait);
> +
>  	btrfs_cleanup_one_transaction(trans->transaction, root);
>  
>  	put_transaction(cur_trans);
> -- 
> 1.7.7.6

Actually ignore this, the problem is btrfs_cleanup_one_transaction is just doing
waitqueue_active() which is racy, we need to fix it to wake_up, so I'll fix that
and send it along.  Thanks,

Josef

      reply	other threads:[~2012-05-31 18:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-31 15:14 [PATCH] Btrfs: make sure to unblock the transaction when cleaning it up Josef Bacik
2012-05-31 18:30 ` Josef Bacik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120531183028.GG2080@localhost.localdomain \
    --to=josef@redhat.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.