From: Omar Sandoval <osandov@osandov.com>
To: Filipe Manana <fdmanana@gmail.com>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>, kernel-team@fb.com
Subject: Re: [PATCH v2 3/4] btrfs-progs: receive: don't lookup clone root for received subvolume
Date: Wed, 11 Mar 2020 01:03:27 -0700 [thread overview]
Message-ID: <20200311080327.GA252106@vader> (raw)
In-Reply-To: <CAL3q7H7Yv+OjcJ4cDxwZ7x+k2z10s7yin0FTkNxaZvZ7AkVJ3A@mail.gmail.com>
On Mon, Feb 24, 2020 at 02:53:51PM +0000, Filipe Manana wrote:
> On Tue, Jul 23, 2019 at 12:19 PM Filipe Manana <fdmanana@gmail.com> wrote:
> >
> > On Tue, Jul 23, 2019 at 3:25 AM Omar Sandoval <osandov@osandov.com> wrote:
> > >
> > > From: Omar Sandoval <osandov@fb.com>
> > >
> > > When we process a clone request, we look up the source subvolume by
> > > UUID, even if the source is the subvolume that we're currently
> > > receiving. Usually, this is fine. However, if for some reason we
> > > previously received the same subvolume, then this will use paths
> > > relative to the previously received subvolume instead of the current
> > > one. This is incorrect, since the send stream may use temporary names
> > > for the clone source. This can be reproduced as follows:
> > >
> > > btrfs subvolume create subvol
> > > dd if=/dev/urandom of=subvol/foo bs=1M count=1
> > > cp --reflink subvol/foo subvol/bar
> > > mkdir subvol/dir
> > > mv subvol/foo subvol/dir/
> > > btrfs property set subvol ro true
> > > btrfs send -f send.data subvol
> > > mkdir first second
> > > btrfs receive -f send.data first
> > > btrfs receive -f send.data second
> > >
> > > The second receive results in this error:
> > >
> > > ERROR: cannot open first/subvol/o259-7-0/foo: No such file or directory
> > >
> > > Fix it by always cloning from the current subvolume if its UUID matches.
> > > This has the nice side effect of avoiding unnecessary UUID tree lookups
> > > in that case.
> > >
> > > Fixes: f1c24cd80dfd ("Btrfs-progs: add btrfs send/receive commands")
> > > Signed-off-by: Omar Sandoval <osandov@fb.com>
> >
> > Reviewed-by: Filipe Manana <fdmanana@suse.com>
>
> I can't find this patch in btrfs-progs. Any reason why it was never applied?
>
> thanks
It must have gotten lost at some point. I'll resend it.
next prev parent reply other threads:[~2020-03-11 8:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-22 19:15 [PATCH v2 0/4] btrfs-progs: fix clone from wrong subvolume Omar Sandoval
2019-07-22 19:15 ` [PATCH v2 1/4] btrfs-progs: receive: remove commented out transid checks Omar Sandoval
2019-07-24 11:22 ` David Sterba
2019-07-24 12:10 ` Filipe Manana
2019-07-22 19:15 ` [PATCH v2 2/4] btrfs-progs: receive: get rid of unnecessary strdup() Omar Sandoval
2019-07-22 19:15 ` [PATCH v2 3/4] btrfs-progs: receive: don't lookup clone root for received subvolume Omar Sandoval
2019-07-23 11:19 ` Filipe Manana
2020-02-24 14:53 ` Filipe Manana
2020-03-11 8:03 ` Omar Sandoval [this message]
2019-07-22 19:15 ` [PATCH v2 4/4] btrfs-progs: tests: add test for receiving clone from duplicate subvolume Omar Sandoval
2019-07-23 11:21 ` Filipe Manana
2019-09-04 20:35 ` [PATCH v2 0/4] btrfs-progs: fix clone from wrong subvolume Omar Sandoval
2019-10-10 7:06 ` Qu Wenruo
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=20200311080327.GA252106@vader \
--to=osandov@osandov.com \
--cc=fdmanana@gmail.com \
--cc=kernel-team@fb.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