From: Josef Bacik <josef@redhat.com>
To: miaox@cn.fujitsu.com
Cc: Chris Mason <chris.mason@oracle.com>,
Linux Btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 2/2] btrfs: fix deadlock when doing reservation
Date: Wed, 15 Jun 2011 09:44:02 -0400 [thread overview]
Message-ID: <4DF8B722.2090704@redhat.com> (raw)
In-Reply-To: <4DF88DCF.2030502@cn.fujitsu.com>
On 06/15/2011 06:47 AM, Miao Xie wrote:
> The following deadlock may happen when doing reservation for metadata:
>
> Task0 Flush thread Task1
> start_transaction()
> shrink_delalloc()
> writeback_inodes_sb_nr()
> wait for flush thread
> end.
> btrfs_writepages()
> cow_file_range()
> btrfs_commit_transaction
> wait num_writer == 1
> (wait Task0 end
> transaction)
> start_transaction()
> wait trans commit
> end
>
> Task0 -> Flush thread -> Task1 -> Task0
>
> Fix the above deadlock by doing reservation before the trans handle has
> been joined into the transaction.
>
> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
I've already taken care of this in
[PATCH 1/2] Btrfs: do transaction space reservation before joining the
transaction
Thanks,
Josef
next prev parent reply other threads:[~2011-06-15 13:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-15 10:47 [PATCH 2/2] btrfs: fix deadlock when doing reservation Miao Xie
2011-06-15 13:44 ` Josef Bacik [this message]
2011-06-16 14:36 ` Mitch Harder
2011-06-16 14:52 ` Josef Bacik
2011-06-16 17:17 ` Mitch Harder
2011-06-16 17:17 ` Josef Bacik
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=4DF8B722.2090704@redhat.com \
--to=josef@redhat.com \
--cc=chris.mason@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=miaox@cn.fujitsu.com \
/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).