linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <jbacik@fb.com>
To: Wang Shilong <wangshilong1991@gmail.com>
Cc: <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] Btrfs: remove transaction from send
Date: Fri, 14 Mar 2014 10:44:32 -0400	[thread overview]
Message-ID: <532315D0.7090805@fb.com> (raw)
In-Reply-To: <892DD229-24DA-439C-B431-2761E51A9937@gmail.com>

On 03/14/2014 09:13 AM, Wang Shilong wrote:
>> Lets try this again.  We can deadlock the box if we send on a box and try to
>> write onto the same fs with the app that is trying to listen to the send pipe.
>> This is because the writer could get stuck waiting for a transaction commit
>> which is being blocked by the send.  So fix this by making sure looking at the
>> commit roots is always going to be consistent.  We do this by keeping track of
>> which roots need to have their commit roots swapped during commit, and then
>> taking the commit_root_sem and swapping them all at once.  Then make sure we
>> take a read lock on the commit_root_sem in cases where we search the commit root
>> to make sure we're always looking at a consistent view of the commit roots.
>> Previously we had problems with this because we would swap a fs tree commit root
>> and then swap the extent tree commit root independently which would cause the
>> backref walking code to screw up sometimes.  With this patch we no longer
>> deadlock and pass all the weird send/receive corner cases.  Thanks,
> 
> Now btrfs send are alway searching commit root! Your codes only seems to protect backref codes,
> it reduce transaction blocked but make it not safe as we have discussed before.
> 
>

I was trying to remember why we didn't like this solution before but I
couldn't come up with anything.  Apparently I haven't completely fixed
the problem yet so stay tuned for what I do next ;).  Thanks,

Josef


      reply	other threads:[~2014-03-14 14:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-13 19:42 [PATCH] Btrfs: remove transaction from send Josef Bacik
2014-03-13 22:16 ` Hugo Mills
2014-03-14  8:40   ` Hugo Mills
2014-03-14 18:51   ` Josef Bacik
2014-03-14 22:44     ` Hugo Mills
2014-03-15 13:27       ` Hugo Mills
2014-03-14 13:13 ` Wang Shilong
2014-03-14 14:44   ` 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=532315D0.7090805@fb.com \
    --to=jbacik@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wangshilong1991@gmail.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).