linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wang Shilong <wangshilong1991@gmail.com>
To: Josef Bacik <jbacik@fb.com>
Cc: <linux-btrfs@vger.kernel.org>, Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Subject: Re: [PATCH] Btrfs: convert to add transaction protection for btrfs send
Date: Wed, 5 Feb 2014 16:59:39 +0800	[thread overview]
Message-ID: <15BD028C-7568-4ACF-84D1-CA39092AD285@gmail.com> (raw)
In-Reply-To: <52F00AAE.6070509@fb.com>


Hi Josef,

[..SNIP..]
> 
> On 01/31/2014 11:37 AM, Wang Shilong wrote:
>> Hello Josef,
>> 
>>>  
> 
> 2) Remove the per-root rwsem for the commit root and just make one big
> rwsem that covers all commit root switching. This way everybody who
> wants to search with the commit root can just use this semaphore and all
> be safe. It will mean that the inode cache stuff may block longer than
> normal but I don't think that's too big of a deal.
> 

I am ok with this fix,  I wanted to talk something about protecting searching commit file root, this is really a
problem especially for full send.

I have some ideas about this issue:

#1.don't use commit file root to search.
This will become a nightmare when we are doing full send which will iterate the whole file tree,
at the same time, we snapshot send root, snapshots will be blocked until send finished.

#2. don't allow snapshot if we are sending root.
This may be a little confusing, snapshots are readonly, but users can not snapshot it.

#3. after one iteration, we do check send_root's generation, and make sure it doesn't
change, if it changed, then we restart send again.

I don't know which approach is better,and also snapshot-aware defragment will change
read-only snapshot?

Did you have any better ideas about this issue? Share it with me here.^_^

Thanks,
Wang
> 
> Josef


  reply	other threads:[~2014-02-05  8:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-29 15:32 [PATCH] Btrfs: convert to add transaction protection for btrfs send Wang Shilong
2014-01-29 15:32 ` Wang Shilong
2014-01-29 19:00 ` Josef Bacik
2014-01-30  9:42   ` Wang Shilong
2014-01-30 16:08     ` Josef Bacik
2014-01-30 16:20       ` Wang Shilong
2014-01-30 16:23         ` Josef Bacik
2014-01-30 16:42           ` Wang Shilong
2014-01-31 16:37             ` Wang Shilong
2014-01-31 23:40               ` Josef Bacik
2014-02-03 21:31               ` Josef Bacik
2014-02-05  8:59                 ` Wang Shilong [this message]
2014-02-05 14:04                   ` Josef Bacik
2014-02-05 17:23                     ` Wang Shilong
2014-02-05 20:47                       ` Josef Bacik
2014-02-08  3:06                         ` Wang Shilong

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=15BD028C-7568-4ACF-84D1-CA39092AD285@gmail.com \
    --to=wangshilong1991@gmail.com \
    --cc=jbacik@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --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).