From owner-freebsd-fs@FreeBSD.ORG Tue Jul 2 00:07:47 2013 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7A8ED477; Tue, 2 Jul 2013 00:07:47 +0000 (UTC) (envelope-from jdc@koitsu.org) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by mx1.freebsd.org (Postfix) with ESMTP id 3A3F01A88; Tue, 2 Jul 2013 00:07:47 +0000 (UTC) Received: from mfilter24-d.gandi.net (mfilter24-d.gandi.net [217.70.178.152]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id 479F0A80B6; Tue, 2 Jul 2013 02:07:36 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter24-d.gandi.net Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by mfilter24-d.gandi.net (mfilter24-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id 0hYqt874lplK; Tue, 2 Jul 2013 02:07:34 +0200 (CEST) X-Originating-IP: 76.102.14.35 Received: from jdc.koitsu.org (c-76-102-14-35.hsd1.ca.comcast.net [76.102.14.35]) (Authenticated sender: jdc@koitsu.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 63B1DA80B4; Tue, 2 Jul 2013 02:07:34 +0200 (CEST) Received: by icarus.home.lan (Postfix, from userid 1000) id 8F41C73A1C; Mon, 1 Jul 2013 17:07:32 -0700 (PDT) Date: Mon, 1 Jul 2013 17:07:32 -0700 From: Jeremy Chadwick To: Robert Millan Subject: Re: Compatibility options for mount(8) Message-ID: <20130702000732.GA72587@icarus.home.lan> References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Q68bSM7Ycu6FN28Q" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-fs@freebsd.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jul 2013 00:07:47 -0000 --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jul 02, 2013 at 01:11:52AM +0200, Robert Millan wrote: > Hi, > > On Debian GNU/kFreeBSD, we've been using these bits of glue to make > FreeBSD mount a bit more compatible with the Linux version of mount. > > We found that this occasionally helps when porting software that needs > to use those features and relies on Linux semantics: > > - Ignore "-n" flag, since it requests not to update /etc/mtab, which > we never do anyway. > > - Map "-o remount" to its FreeBSD equivalent, "-o update". > > I'd like to check in the attached patch. Please have a look! Minor but are well-justified given quality of code: 1. Put "n" in alphabetical order/after "l" and not at the end of the getopt() string, i.e.: while ((ch = getopt(argc, argv, "adF:fLlno:prt:uvw")) != -1) 2. Please use strncmp(). I know other parts of the same code use strcmp() and those should really be improved at some other time, but while you're already there you might as well use strncmp() (you'll see others have done the same), i.e.: } else if (strncmp(p, "remount", 7) == 0) { And finally: 3. mount(8) man page should reflect these (IMO). Attached is the diff for that; wording based off of some other man pages. -- | Jeremy Chadwick jdc@koitsu.org | | UNIX Systems Administrator http://jdc.koitsu.org/ | | Making life hard for others since 1977. PGP 4BD6C0CB | --Q68bSM7Ycu6FN28Q Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="mount.8.diff" Index: mount.8 =================================================================== --- mount.8 (revision 252457) +++ mount.8 (working copy) @@ -106,6 +106,9 @@ a file system mount status from read-write to read Also forces the R/W mount of an unclean file system (dangerous; use with caution). +.It Fl n +For compatibility with some other implementations; this flag is +currently a no-op. .It Fl l When used in conjunction with the .Fl a @@ -239,6 +242,10 @@ It is set automatically when the user does not hav .It Cm nosymfollow Do not follow symlinks on the mounted file system. +.It Cm remount +The same as +.Cm update ; +for compatibility with some other implementations. .It Cm ro The same as .Fl r ; --Q68bSM7Ycu6FN28Q--