From owner-svn-src-head@freebsd.org Thu Jul 13 19:17:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22B3DDABD9F; Thu, 13 Jul 2017 19:17:44 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA14B85DEE; Thu, 13 Jul 2017 19:17:43 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v6DJBVQJ090067; Thu, 13 Jul 2017 12:11:31 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v6DJBTMC090066; Thu, 13 Jul 2017 12:11:29 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201707131911.v6DJBTMC090066@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r320803 - head/sbin/mount In-Reply-To: <5242112.0aHCQARnit@ralph.baldwin.cx> To: John Baldwin Date: Thu, 13 Jul 2017 12:11:29 -0700 (PDT) CC: Ian Lepore , Edward Tomasz Napierala , rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 19:17:44 -0000 > 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