Date: Mon, 1 Jul 2013 17:07:32 -0700 From: Jeremy Chadwick <jdc@koitsu.org> To: Robert Millan <rmh@freebsd.org> Cc: freebsd-fs@freebsd.org Subject: Re: Compatibility options for mount(8) Message-ID: <20130702000732.GA72587@icarus.home.lan> In-Reply-To: <CAOfDtXM_KJeLLUcsFA0EZOC8ZgSjKiLKuGeeNPQKCcZwcaJbCQ@mail.gmail.com> References: <CAOfDtXM_KJeLLUcsFA0EZOC8ZgSjKiLKuGeeNPQKCcZwcaJbCQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130702000732.GA72587>