lkml.org 
[lkml]   [2015]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 4/6] Btrfs: fail on mismatched subvol and subvolid mount options
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).


\
 
 \ /
  Last update: 2015-04-14 17:21    [W:0.057 / U:13.908 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site