Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Jul 2017 12:11:29 -0700 (PDT)
From:      "Rodney W. Grimes" <freebsd@pdx.rh.CN85.dnsmgr.net>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Ian Lepore <ian@freebsd.org>, Edward Tomasz Napierala <trasz@freebsd.org>,  rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r320803 - head/sbin/mount
Message-ID:  <201707131911.v6DJBTMC090066@pdx.rh.CN85.dnsmgr.net>
In-Reply-To: <5242112.0aHCQARnit@ralph.baldwin.cx>

next in thread | previous in thread | raw e-mail | index | archive | help
> On Tuesday, July 11, 2017 02:35:15 PM Ian Lepore wrote:
> > I think the docs on this are pretty clear... under -u it says:
> > 
> >     The set of options is determined by applying the options specified
> >     in the argument to -o and finally applying the -r or -w option.
> > 
> > To me, that says that nothing in /etc/fstab is germane to mount -u
> > unless one of the other args to mount -u is -o fstab.
> > 
> > This change (r320803) seems like an acceptable workaround, but I think
> > the correct long term fix would be to not even open /etc/fstab on mount
> > -u without -o fstab.  But that may be harder to do than to say; I still
> > haven't actually looked at the code involved.
> 
> I concur with this.  I've always viewed '-u' as meaning "apply a delta
> to the current configuration", not "add this delta to the fstab options
> and then apply that entire set of options".   In practice, it seems that
> it doesn't do either of those, but instead it seems to treats the options
> passed to -o as the entire list of options.  This is perhaps a bit
> surprising.
> 
> For example, suppose you had this:
> 
> /etc/fstab:
> 
> /dev/md0        /bar            ufs     ro,noauto,noexec        0       0
...

To shed some light on all of this I did the dig to find the original
documentaton on mount -u, which actually makes it rather clear what
and how things should be happening.  Somehow this has been lost over
the years:
csrg change to mount.c adding -u
https://svnweb.freebsd.org/csrg/sbin/mount/mount.c?r1=39329&r2=39333

csrg change to mount.8 documenting -u
https://svnweb.freebsd.org/csrg/sbin/mount/mount.8?r1=39328&r2=39466
This documenting of -u clearly states that /etc/fstab shall be
consulted during a mount -u, some place we lost that.


-- 
Rod Grimes                                                 rgrimes@freebsd.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707131911.v6DJBTMC090066>