From: Liu Bo <bo.li.liu@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH] Btrfs: avoid deadlock in btrfs_async_run_delayed_root
Date: Fri, 20 Oct 2017 17:40:12 -0600 [thread overview]
Message-ID: <20171020234012.9929-1-bo.li.liu@oracle.com> (raw)
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
next reply other threads:[~2017-10-21 0:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-20 23:40 Liu Bo [this message]
2017-10-21 5:41 ` [PATCH] Btrfs: avoid deadlock in btrfs_async_run_delayed_root Liu Bo
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=20171020234012.9929-1-bo.li.liu@oracle.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).