All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liu Bo <bo.li.liu@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: avoid deadlock in btrfs_async_run_delayed_root
Date: Fri, 20 Oct 2017 22:41:22 -0700	[thread overview]
Message-ID: <20171021054122.GA1696@lim.localdomain> (raw)
In-Reply-To: <20171020234012.9929-1-bo.li.liu@oracle.com>

Hi,

Please ignore this patch, I misunderstood the lock order.

thanks,

-liubo

On Fri, Oct 20, 2017 at 05:40:12PM -0600, Liu Bo wrote:
> Here %path is set with ->leave_spinning=1, thus it'll hold the rwlock
> after btrfs_search_slot(), however, when processing delayed items in
> __btrfs_commit_inode_delayed_items(), it goes to acquire node->mutex
> which might sleep, that is, it may sleep under spin_lock.
> 
> Given node->mutex is necessary to avoid race between async works, this
> remove the ->leave_spining setting.
> 
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
> ---
>  fs/btrfs/delayed-inode.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
> index 19e4ad2..a857a2f 100644
> --- a/fs/btrfs/delayed-inode.c
> +++ b/fs/btrfs/delayed-inode.c
> @@ -1331,7 +1331,6 @@ static void btrfs_async_run_delayed_root(struct btrfs_work *work)
>  	if (!delayed_node)
>  		goto free_path;
>  
> -	path->leave_spinning = 1;
>  	root = delayed_node->root;
>  
>  	trans = btrfs_join_transaction(root);
> -- 
> 2.9.4
> 
> --
> 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

      reply	other threads:[~2017-10-21  5:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-20 23:40 [PATCH] Btrfs: avoid deadlock in btrfs_async_run_delayed_root Liu Bo
2017-10-21  5:41 ` Liu Bo [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=20171021054122.GA1696@lim.localdomain \
    --to=bo.li.liu@oracle.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.