public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: "Misono, Tomohiro" <misono.tomohiro@jp.fujitsu.com>
Cc: Hugo Mills <hugo@carfax.org.uk>,
	Andrei Borzenkov <arvidjaar@gmail.com>,
	linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH v2] btrfs-progs: subvol: change subvol set-default to also accept subvol path
Date: Wed, 4 Oct 2017 20:07:10 +0200	[thread overview]
Message-ID: <20171004180710.GF3521@twin.jikos.cz> (raw)
In-Reply-To: <45a84df9-fd06-ca72-3379-4594fceb4b5a@jp.fujitsu.com>

On Tue, Oct 03, 2017 at 08:57:52AM +0900, Misono, Tomohiro wrote:
> On 2017/10/02 18:01, Hugo Mills wrote:
> > On Mon, Oct 02, 2017 at 11:39:05AM +0300, Andrei Borzenkov wrote:
> >> On Mon, Oct 2, 2017 at 11:19 AM, Misono, Tomohiro
> >> <misono.tomohiro@jp.fujitsu.com> wrote:
> >>> This patch changes "subvol set-default" to also accept the subvolume path
> >>> for convenience.
> >>>
> >>> This is the one of the issue on github:
> >>> https://github.com/kdave/btrfs-progs/issues/35
> >>>
> >>> If there are two args, they are assumed as subvol id and path to the fs
> >>> (the same as current behavior), and if there is only one arg, it is assumed
> >>> as the path to the subvolume. Therefore there is no ambiguity between subvol
> >>> id and subvol name, which is mentioned in the above issue page.
> >>>
> >>> Only the absolute path to the subvolume is allowed, for the safety when
> >>> multiple filesystems are used.
> >>>
> >>> subvol id is resolved by get_subvol_info() which is used by "subvol show".
> >>>
> >>> change to v2:
> >>> restrict the path to only allow absolute path.
> >>
> >> This is absolutely arbitrary restriction. Why we can do "btrfs
> >> subvolume create ./relative/path" but cannot do "btrfs subvolume
> >> set-default ./relative/path"?
> > 
> >    Indeed. In fact, it's precisely the _opposite_ of the way that
> > every other command works -- you provide the path to the subvolume in
> > the *current namespace*.
> > 
> >    This approach would be just a major misfeature at this point.
> Ok, I understood the point and want to revert this.
> Please review the first version if possible:
> https://mail-archive.com/linux-btrfs@vger.kernel.org/msg68486.html

I agree with Andrei and Hugo. We need to check that the subvolume path
belongs to the filesystem anyway. I don't see that in the first version,
so please fix it.

  reply	other threads:[~2017-10-04 18:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-02  8:19 [PATCH v2] btrfs-progs: subvol: change subvol set-default to also accept subvol path Misono, Tomohiro
2017-10-02  8:39 ` Andrei Borzenkov
2017-10-02  9:01   ` Hugo Mills
2017-10-02 23:57     ` Misono, Tomohiro
2017-10-04 18:07       ` David Sterba [this message]
2017-10-05  0:57         ` Misono, Tomohiro
2017-10-05 15:14           ` David Sterba

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=20171004180710.GF3521@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=arvidjaar@gmail.com \
    --cc=hugo@carfax.org.uk \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=misono.tomohiro@jp.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