All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>
Cc: Omar Sandoval <osandov@osandov.com>, Chris Mason <clm@fb.com>,
	Josef Bacik <jbacik@fb.com>, David Sterba <dsterba@suse.cz>,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 4/6] Btrfs: fail on mismatched subvol and subvolid mount options
Date: Tue, 14 Apr 2015 17:07:43 +0200	[thread overview]
Message-ID: <20150414150743.GR25622@twin.jikos.cz> (raw)
In-Reply-To: <55271BD9.7020903@cn.fujitsu.com>

On Fri, Apr 10, 2015 at 08:39:53AM +0800, Qu Wenruo wrote:
> > There's nothing to stop a user from passing both subvol= and subvolid=
> > to mount, but if they don't refer to the same subvolume, someone is
> > going to be surprised at some point. Error out on this case, but allow
> > users to pass in both if they do match (which they could, for example,
> > get out of /proc/mounts).
> Not sure should we do this extra check, as later mount options override 
> previous mount option.
> 
> I previous tried to do such thing for mount option like inode/noinode, 
> but was rejected for that reason.

Do you have a link to the discussion?

> So not sure such error-out behavior is OK or not.
> Maybe only taking the latest subvol/subvolid is a better choice?

If not sure, follow the principle of least surprise. If both subvolid
and subvol are passed and match then it's IMHO ok, no matter if the
options match "by accident" or intentionally. Eg. copy&paste from
/proc/mounts should work.

If the options do not match we can't decide which one is the right one.
The surprise would come if the user wants one (eg. subvolid) but the
other one would be applied in the end (subvol).

  reply	other threads:[~2015-04-14 15:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-09 21:34 [PATCH v2 0/6] Btrfs: show subvolume name and ID in /proc/mounts Omar Sandoval
2015-04-09 21:34 ` [PATCH v2 1/6] Btrfs: lock superblock before remounting for rw subvol Omar Sandoval
2015-05-11 16:07   ` David Sterba
2015-04-09 21:34 ` [PATCH v2 2/6] Btrfs: remove all subvol options before mounting top-level Omar Sandoval
2015-05-11 16:08   ` David Sterba
2015-04-09 21:34 ` [PATCH v2 3/6] Btrfs: clean up error handling in mount_subvol() Omar Sandoval
2015-05-11 16:08   ` David Sterba
2015-04-09 21:34 ` [PATCH v2 4/6] Btrfs: fail on mismatched subvol and subvolid mount options Omar Sandoval
2015-04-10  0:39   ` Qu Wenruo
2015-04-14 15:07     ` David Sterba [this message]
2015-05-11 16:09   ` David Sterba
2015-04-09 21:34 ` [PATCH v2 5/6] Btrfs: unify subvol= and subvolid= mounting Omar Sandoval
2015-05-11 15:37   ` David Sterba
2015-05-11 21:15     ` Omar Sandoval
2015-05-11 16:10   ` David Sterba
2015-04-09 21:34 ` [PATCH v2 6/6] Btrfs: show subvol= and subvolid= in /proc/mounts Omar Sandoval
2015-05-11 16:10   ` David Sterba
2015-05-11  9:42 ` [PATCH v2 0/6] Btrfs: show subvolume name and ID " Omar Sandoval
2015-05-11 14:51   ` David Sterba
2015-05-11 21:20     ` Omar Sandoval
2015-05-12  0:46   ` 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=20150414150743.GR25622@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=clm@fb.com \
    --cc=jbacik@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=osandov@osandov.com \
    --cc=quwenruo@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.