svn commit: r320803 - head/sbin/mount

Rodney W. Grimes freebsd at pdx.rh.CN85.dnsmgr.net
Sat Jul 8 17:34:55 UTC 2017


[ Charset ISO-8859-1 unsupported, converting... ]
> On 0708T1102, Ian Lepore wrote:
> > On Sat, 2017-07-08 at 09:50 -0700, Rodney W. Grimes wrote:
> > > [ Charset UTF-8 unsupported, converting... ]
> > > > 
> > > > Author: trasz
> > > > Date: Sat Jul??8 11:06:27 2017
> > > > New Revision: 320803
> > > > URL: https://svnweb.freebsd.org/changeset/base/320803
> > > > 
> > > > Log:
> > > > ? Fix "mount -uw /" when the filesystem type doesn't match.
> > > > ??
> > > > ? This basically makes "mount -uw /" work when the filesystem
> > > > ? mounted on / is NFS, but the one configured in fstab(5) is UFS,
> > > > ? which can happen when you forget to modify fstab.
> > > Please do not silence user errors because they are inconvinient,
> > > this is a configuration error and the system should fail to?
> > > mount the incorrectly configured root.
> > > 
> > > If we start changing things to silently ignore user configuration
> > > errors we are going down a very slippery road.
> 
> It doesn't silence down the error.  What it does is it makes it possible
> to use "mount -uw /" - previously it would fail in a rather nonsensical
> way, by calling "mount_nfs -o upgrade,rw /dev/ada0 /".

It DOES silence the error.  My configuration TOLD it to execute that
rather nonsensical command, your change now causes it to execute something
that my configuration did NOT tell it to do.

> > IMO, this change fixes the right problem, but maybe does so the wrong
> > way. ?Mount -u is by definition an update to an existing mount. ?There
> > should be no need to consult /etc/fstab for an existing mount since the
> > info is available from the kernel.
> > 
> > Note that I say the foregoing with my user hat on. ?I haven't looked at
> > the code to see if there's some reason why my common-sensical way of
> > thinking about it is actually impossible to implement for some reason.
> 
> I wouldn't expect it to consult fstab either, to be honest.  But it does,
> and I suspect changing that would break someone's config.

It reads the fstab to get the options that may be specified there
that your mount -uw / command does not specify, realize the kernel
when mounting / does so in a very minimal way, when you invoke
mount -u the parameters in /etc/fstab come in to play.

I believe KIB refered to this during your differential when he said
something like "what if the options disagree".


-- 
Rod Grimes                                                 rgrimes at freebsd.org


More information about the svn-src-head mailing list