linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Stefan Paletta <stefanp@cabal1.net>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: why check f_path.mnt is equal for source and dest in btrfs_ioctl_clone()?
Date: Mon, 1 Jul 2013 18:21:22 +0200	[thread overview]
Message-ID: <20130701162122.GE18204@twin.jikos.cz> (raw)
In-Reply-To: <kqoobm$jq4$1@ger.gmane.org>

On Sun, Jun 30, 2013 at 09:55:26AM +0200, Stefan Paletta wrote:
> This gives EXDEV for clone operations that btrfs could otherwise execute and
> with slight change of circumstances will actually execute fine.
> 
> Imagine we have a btrfs on /dev/mapper/foobar with subvols /foo and /bar.
> Let’s also imagine top of said fs in mounted at /mnt. In this case, a
> cross-subvol clone of /mnt/foo/srcfile to /mnt/bar/dstfile will succeed.

This does not cross a mountpoint.

> However, if only the individual subvols were mounted like this:
> 	/dev/mapper/foobar on /mnt (subvol=foo)
> 	/dev/mapper/foobar on /mnt2 (subvol=bar),
> then a clone of /mnt/srcfile to /mnt2/dstfile will fail with EXDEV even
> though it is otherwise equal to the former clone operation.

And this does. This is prevented for the same reason hadlinks do not
work accross mountpoints when the same filesytem is mounted multiple
times.

> Would anyone care to shed some light on this? Is it due to legacy policy? Am
> I missing something?

http://thread.gmane.org/gmane.comp.file-systems.btrfs/9867

Although it's more about reflink/clone spanning subvolumes regardless of
the mountpoints, there's an objection against file operations performed
accross vfsmounts and current implementation respects that.

david

      reply	other threads:[~2013-07-01 16:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-30  7:55 why check f_path.mnt is equal for source and dest in btrfs_ioctl_clone()? Stefan Paletta
2013-07-01 16:21 ` David Sterba [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=20130701162122.GE18204@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=stefanp@cabal1.net \
    /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).