linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <jbacik@fb.com>
To: Wang Shilong <wangshilong1991@gmail.com>, <linux-btrfs@vger.kernel.org>
Cc: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Subject: Re: [RFC PATCH 2/2] Revert "Btrfs: remove transaction from btrfs send"
Date: Mon, 10 Feb 2014 10:41:10 -0500	[thread overview]
Message-ID: <52F8F316.8070105@fb.com> (raw)
In-Reply-To: <1391874396-2273-2-git-send-email-wangshilong1991@gmail.com>



On 02/08/2014 10:46 AM, Wang Shilong wrote:
> From: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
>
> This reverts commit 41ce9970a8a6a362ae8df145f7a03d789e9ef9d2.
> Previously i was thinking we can use readonly root's commit root
> safely while it is not true, readonly root may be cowed with the
> following cases.
>
> 1.snapshot send root will cow source root.
> 2.balance,device operations will also cow readonly send root
> to relocate.
>
> So i have two ideas to make us safe to use commit root.
>
> -->approach 1:
> make it protected by transaction and end transaction properly and we research
> next item from root node(see btrfs_search_slot_for_read()).
>
> -->approach 2:
> add another counter to local root structure to sync snapshot with send.
> and add a global counter to sync send with exclusive device operations.
>
> So with approach 2, send can use commit root safely, because we make sure
> send root can not be cowed during send. Unfortunately, it make codes *ugly*
> and more complex to maintain.
>
> To make snapshot and send exclusively, device operations and send operation
> exclusively with each other is a little confusing for common users.
>
> So why not drop into previous way.
>
> Cc: Josef Bacik <jbacik@fb.com>
> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
> ---
> Josef, if we reach agreement to adopt this approach, please revert
> Filipe's patch(Btrfs: make some tree searches in send.c more efficient)
> from btrfs-next.

I agree, I'll leave Filipe's patch alone but I'll drop my search commit 
root patch since we don't need it any more.  Do you want me to take this 
or do you want to resubmit without the rfc?  Thanks,

Josef

      parent reply	other threads:[~2014-02-10 15:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-08 15:46 [PATCH 1/2] Btrfs: skip readonly root for snapshot-aware defragment Wang Shilong
2014-02-08 15:46 ` [RFC PATCH 2/2] Revert "Btrfs: remove transaction from btrfs send" Wang Shilong
2014-02-09  2:39   ` Shilong Wang
2014-02-09 13:52     ` Filipe David Manana
2014-02-09 14:20       ` Shilong Wang
2014-02-10 15:41   ` 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=52F8F316.8070105@fb.com \
    --to=jbacik@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wangshilong1991@gmail.com \
    --cc=wangsl.fnst@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).