All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/8] sys-utils/mount.8: Clarify 'defaults' and separate kernel/userspace options
@ 2017-06-23 21:30 W. Trevor King
  2017-06-23 21:30 ` [PATCH v2 1/8] sys-utils/fstab.5: Remove basic filesystem-independent options W. Trevor King
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: W. Trevor King @ 2017-06-23 21:30 UTC (permalink / raw)
  To: util-linux; +Cc: Karel Zak, W. Trevor King

Here's a reroll of May's v1 [1].  Larger changes since v1:

* Split into multiple patches, something like Karel had suggested [2].
* Punt to mount(2) for defaults for filesystem-independent kernel
  options, instead of adding local "(default)" marks.  This is is also
  something like Karl had suggested in [2].
* Replaced the broken "synonym for auto" 'defaults' definition which
  I'd floated in v1 with a line from Karel's earlier suggestion [3].
* Added two examples to fstab(5) based on Karel's initial suggestions
  [4] and subsequent discussion.
* Added a few copy-edit patches.

After the v1 discussion, I think something should happen to (no)auto
as well:

On Tue, May 16, 2017 at 02:41:27PM +0200, Karel Zak wrote [2]:
> On Fri, May 12, 2017 at 10:36:29AM -0700, W. Trevor King wrote:
> > > > >    The "default" is interpreted as "auto" by "mount -a".
> > > >
> > > > This last line means "defaults" is effectively a synonym for
> > > > "auto" in fstab, an presumably "auto" would always be
> > > > preferred (because it more
> > >
> > > More precisely, mount -a cares about "noauto" only, everything
> > > else is "auto".
> >
> > Is that really true?  I think:
> >
> > * ‘noauto,auto’ means the same thing as a bare ‘auto’.
>
> Unfortunately no.
>
> It's strange, but "mount -a" search for "noauto" and do not evaluate
> the options as flags. The libmount follows the original mount(8)
> with this behavior. I'll try to fix it.

It's not clear to me whether Karel intends to clarify the mount(8)
documentation on this point or if he intends to adjust the current
libmount behavior, so I've left that language alone in this series.
If the intention is to document 'auto' as another no-op (matching the
current implementation), I'm happy to submit an additional patch.

Cheers,
Trevor

[1]: http://marc.info/?l=util-linux-ng&m=149451719727754&w=2
     Message-Id: <cee125bdea0faac3b4c9d7e856425fe9106756e7.1494510090.git.wking@tremily.us>
     Subject: [PATCH] WIP: mount.8: Split out fstab-specific mount options
     Date: Thu, 11 May 2017 06:48:54 -0700
[2]: http://marc.info/?l=util-linux-ng&m=149493849402047&w=2
     Message-ID: <20170516124127.tuul34kfniki7f4y@ws.net.home>
     Subject: Re: [PATCH] WIP: mount.8: Split out fstab-specific mount options
     Date: Tue, 16 May 2017 14:41:27 +0200
[3]: http://marc.info/?l=util-linux-ng&m=149450548823490&w=2
     Message-ID: <20170511122442.qwzpw7f6xdsc7im2@ws.net.home>
     Subject: Re: libmount: Is the 'defaults' option intentionally a no-op?
     Date: Thu, 11 May 2017 14:24:42 +0200
[4]: http://marc.info/?l=util-linux-ng&m=149457573010153&w=2
     Message-ID: <20170512075451.auqemicjfogreepq@ws.net.home>
     Subject: Re: [PATCH] WIP: mount.8: Split out fstab-specific mount options
     Date: Fri, 12 May 2017 09:54:51 +0200

W. Trevor King (8):
  sys-utils/fstab.5: Remove basic filesystem-independent options
  sys-utils/fstab.5: Remove 'defaults' from examples
  sys-utils/mount.8: Document 'defaults' as a no-op
  sys-utils/mount.8: Simplify nouser
  sys-utils/mount.8: Drop systemd paragraph from x-* entry
  sys-utils/mount.8: Clarify x-mount.mkdir deprecation
  sys-utils/mount.8: Split filesystem-independent options into kernel
    and userspace subsections
  sys-utils/mount.8: Document libmount defaults

 sys-utils/fstab.5 |  38 +++------------
 sys-utils/mount.8 | 137 +++++++++++++++++++++++++++++++-----------------------
 2 files changed, 84 insertions(+), 91 deletions(-)

-- 
2.1.0.60.g85f0837


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 1/8] sys-utils/fstab.5: Remove basic filesystem-independent options
  2017-06-23 21:30 [PATCH v2 0/8] sys-utils/mount.8: Clarify 'defaults' and separate kernel/userspace options W. Trevor King
@ 2017-06-23 21:30 ` W. Trevor King
  2017-06-23 21:30 ` [PATCH v2 2/8] sys-utils/fstab.5: Remove 'defaults' from examples W. Trevor King
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: W. Trevor King @ 2017-06-23 21:30 UTC (permalink / raw)
  To: util-linux; +Cc: Karel Zak, W. Trevor King

These options are covered in mount(8), so there's no need to repeat
them here.

Also update mount(8):

* Add the text linking (no)auto to boot time, which was previously
  documented only in fstab(5).
* Document comment=, previously documented only in fstab(5), borrowing
  language from the current mount(8) X-* entry.
* Use bold (instead of quotes) for X- in the X-* entry.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 sys-utils/fstab.5 | 31 ++-----------------------------
 sys-utils/mount.8 | 17 ++++++++++++++---
 2 files changed, 16 insertions(+), 32 deletions(-)

diff --git a/sys-utils/fstab.5 b/sys-utils/fstab.5
index 07d0287..d292f1f 100644
--- a/sys-utils/fstab.5
+++ b/sys-utils/fstab.5
@@ -155,39 +155,12 @@ deprecated).
 .RS
 This field describes the mount options associated with the filesystem.
 
-It is formatted as a comma-separated list of options.
-It contains at least the type of mount
-.RB ( ro
-or
-.BR rw ),
-plus any additional options appropriate to the filesystem
-type (including performance-tuning options).
+It is formatted as a comma-separated list of options, which may depend
+on the filesystem type (including performance-tuning options).
 For details, see
 .BR mount (8)
 or
 .BR swapon (8).
-
-Basic filesystem-independent options are:
-.TP
-.B defaults
-use default options: rw, suid, dev, exec, auto, nouser, and async.
-.TP
-.B noauto
-do not mount when "mount -a" is given (e.g., at boot time)
-.TP
-.B user
-allow a user to mount
-.TP
-.B owner
-allow device owner to mount
-.TP
-.B comment
-or
-.B x-<name>
-for use by fstab-maintaining programs
-.TP
-.B nofail
-do not report errors for this device if it does not exist.
 .RE
 
 .B The fifth field
diff --git a/sys-utils/mount.8 b/sys-utils/mount.8
index 3bd278e..7800734 100644
--- a/sys-utils/mount.8
+++ b/sys-utils/mount.8
@@ -870,13 +870,22 @@ inode types (directories too), so it implies \fB\%nodiratime\fR.
 .B auto
 Can be mounted with the
 .B \-a
-option.
+option (e.g., at boot time).
 .TP
 .B noauto
 Can only be mounted explicitly (i.e., the
 .B \-a
 option will not cause the filesystem to be mounted).
 .TP
+.B comment=*
+All options prefixed with
+.BR comment=
+are interpreted as comments or as userspace application-specific options.
+These options are not stored in the user space (e.g. mtab file),
+nor sent to the mount.\fItype\fR helpers nor to the
+.BR mount (2)
+system call.  The suggested format is \fBcomment=\fIappname\fR.\fIoption\fR.
+.TP
 .na
 .BR context=\fIcontext ", " fscontext=\fIcontext ", " defcontext=\fIcontext ", and " \%rootcontext=\fIcontext
 .ad
@@ -1165,8 +1174,10 @@ This option implies the options
 .BR users,exec,dev,suid ).
 .TP
 .B X-*
-All options prefixed with "X-" are interpreted as comments or as userspace
-application-specific options.  These options are not stored in the user space (e.g. mtab file),
+All options prefixed with
+.BR X-
+are interpreted as comments or as userspace application-specific options.
+These options are not stored in the user space (e.g. mtab file),
 nor sent to the mount.\fItype\fR helpers nor to the
 .BR mount (2)
 system call.  The suggested format is \fBX-\fIappname\fR.\fIoption\fR.
-- 
2.1.0.60.g85f0837


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 2/8] sys-utils/fstab.5: Remove 'defaults' from examples
  2017-06-23 21:30 [PATCH v2 0/8] sys-utils/mount.8: Clarify 'defaults' and separate kernel/userspace options W. Trevor King
  2017-06-23 21:30 ` [PATCH v2 1/8] sys-utils/fstab.5: Remove basic filesystem-independent options W. Trevor King
@ 2017-06-23 21:30 ` W. Trevor King
  2017-06-23 21:30 ` [PATCH v2 3/8] sys-utils/mount.8: Document 'defaults' as a no-op W. Trevor King
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: W. Trevor King @ 2017-06-23 21:30 UTC (permalink / raw)
  To: util-linux; +Cc: Karel Zak, W. Trevor King

For each option ((no)auto, rw/ro, etc.), whether an informed user
should explicitly set an option in the fstab entry depends on
something like the following decision tree:

a. If you have a preference (e.g. you want a rw mount)...

   a. If the default is unreliable (e.g. you don't trust the admin who
      configured some tune2fs defaults, or you don't trust the Linux
      devs to not make ro the default in the future), then explicitly
      set the option.

   b. If the default is reliable (e.g. you trust the Linux devs to
      continue to default to rw)...

      a. If your preference matches the default (e.g. you prefer rw
         and the kernel default is rw)...

         a. If you like being explicit, explicitly set the option.

         b. You don't mind being implicit, so leave the option unset.

      b. Your preference does not match the default (e.g. you prefer
         rw), so explicitly set the option.

b. You don't have a preference (e.g. you're fine leaving (no)lazytime
   up to the kernel devs, even if they change their mind), so leave
   the option unset.

'defaults' is a no-op placeholder where you fall into either case
a.b.a.b or case b for *every* possible option.  Once you have a
preference on any option (e.g. you want to use auto_da_alloc and you
don't want to rely on 'tune2fs -o auto_da_alloc', putting you in case
a.a for that option), there's no reason to use defaults.

Falling into case b for every option seems unlikely for a "typical"
example.  Falling into case a.b.a.b for every option is more
reasonable, but neither "is the setting reliable?" (the switch between
case a.a and case a.b) no "do you like being explicit?" (the switch
between case a.b.a.a. and case a.b.a.b) seem like likely choices to
take a hard line on.  Using an explicit setting (e.g. rw, as in the
first example added by this commit) instead of defaults gives you some
paranoid protection from a swapped default at no cost (even saving a
few characters ;).

The label values (MyHomeDev and MyOptDev) are Karel's suggestions [1].
I'd probably use "home" and "opt" as the labels in my own fstab, but
Karel's values make it more clear that the labels are independent from
the target directory.

[1]: Message-ID: <20170512075451.auqemicjfogreepq@ws.net.home>
     Subject: Re: [PATCH] WIP: mount.8: Split out fstab-specific mount options
     Date: Fri, 12 May 2017 09:54:51 +0200

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 sys-utils/fstab.5 | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sys-utils/fstab.5 b/sys-utils/fstab.5
index d292f1f..f3eeda4 100644
--- a/sys-utils/fstab.5
+++ b/sys-utils/fstab.5
@@ -57,12 +57,13 @@ Each filesystem is described on a separate line.
 Fields on each line are separated by tabs or spaces.
 Lines starting with '#' are comments.  Blank lines are ignored.
 .PP
-The following is a typical example of an
+The following are two typical
 .B fstab
-entry:
+entries:
 .sp
 .RS 7
-LABEL=t-home2   /home      ext4    defaults,auto_da_alloc      0  2
+LABEL=MyHomeDev  /home  ext4  rw             0  2
+LABEL=MyOptDev   /opt   ext4  auto_da_alloc  0  2
 .RE
 
 .B The first field
-- 
2.1.0.60.g85f0837


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 3/8] sys-utils/mount.8: Document 'defaults' as a no-op
  2017-06-23 21:30 [PATCH v2 0/8] sys-utils/mount.8: Clarify 'defaults' and separate kernel/userspace options W. Trevor King
  2017-06-23 21:30 ` [PATCH v2 1/8] sys-utils/fstab.5: Remove basic filesystem-independent options W. Trevor King
  2017-06-23 21:30 ` [PATCH v2 2/8] sys-utils/fstab.5: Remove 'defaults' from examples W. Trevor King
@ 2017-06-23 21:30 ` W. Trevor King
  2017-06-23 21:30 ` [PATCH v2 4/8] sys-utils/mount.8: Simplify nouser W. Trevor King
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: W. Trevor King @ 2017-06-23 21:30 UTC (permalink / raw)
  To: util-linux; +Cc: Karel Zak, W. Trevor King

The new line is from:

On Thu, May 11, 2017 at 02:24:42PM +0200, Karel Zak wrote [1]:
> My suggestion (man page):
>
>   default
>
>    No-op placeholder with no impact to the filesystem mount options.
>
>    The real mount options depends on built-in kernel defaults and
>    default mount options defined by filesystem superblock. The usual
>    kernel behaviour is to mount filesystems with rw, suid and exec
>    flags by default. See the beginning of this section for more details.
>
>    The "default" is interpreted as "auto" by "mount -a".

I've dropped the "real mount options" and "See the beginning" lines,
because that's true of every option, not just 'defaults'.

I've dropped the "usual kernel behavior" line, because it seems more
appropriate to document that on the option entry itself
(e.g. documenting that rw is the default on the rw entry).

I've dropped the the "auto" line because "auto" is also currently a
no-op:

On Tue, May 16, 2017 at 02:41:27PM +0200, Karel Zak wrote [2]:
> On Fri, May 12, 2017 at 10:36:29AM -0700, W. Trevor King wrote:
> > > > >    The "default" is interpreted as "auto" by "mount -a".
> > > >
> > > > This last line means "defaults" is effectively a synonym for
> > > > "auto" in fstab, an presumably "auto" would always be
> > > > preferred (because it more
> > >
> > > More precisely, mount -a cares about "noauto" only, everything
> > > else is "auto".
> >
> > Is that really true?  I think:
> >
> > * ‘noauto,auto’ means the same thing as a bare ‘auto’.
>
> Unfortunately no.
>
> It's strange, but "mount -a" search for "noauto" and do not evaluate
> the options as flags. The libmount follows the original mount(8)
> with this behavior. I'll try to fix it.

so there's no special relationship between 'defaults' and 'auto'.

[1]: Message-ID: <20170511122442.qwzpw7f6xdsc7im2@ws.net.home>
     Subject: Re: libmount: Is the 'defaults' option intentionally a no-op?
     Date: Thu, 11 May 2017 14:24:42 +0200
[2]: Message-ID: <20170516124127.tuul34kfniki7f4y@ws.net.home>
     Subject: Re: [PATCH] WIP: mount.8: Split out fstab-specific mount options
     Date: Tue, 16 May 2017 14:41:27 +0200

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 sys-utils/mount.8 | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/sys-utils/mount.8 b/sys-utils/mount.8
index 7800734..26e6ce0 100644
--- a/sys-utils/mount.8
+++ b/sys-utils/mount.8
@@ -960,11 +960,7 @@ For more details, see
 
 .TP
 .B defaults
-Use the default options:
-.BR rw ", " suid ", " dev ", " exec ", " auto ", " nouser ", and " async .
-
-Note that the real set of all default mount options depends on kernel
-and filesystem type.  See the beginning of this section for more details.
+A no-op placeholder with no impact to the filesystem mount options.
 .TP
 .B dev
 Interpret character or block special devices on the filesystem.
-- 
2.1.0.60.g85f0837


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 4/8] sys-utils/mount.8: Simplify nouser
  2017-06-23 21:30 [PATCH v2 0/8] sys-utils/mount.8: Clarify 'defaults' and separate kernel/userspace options W. Trevor King
                   ` (2 preceding siblings ...)
  2017-06-23 21:30 ` [PATCH v2 3/8] sys-utils/mount.8: Document 'defaults' as a no-op W. Trevor King
@ 2017-06-23 21:30 ` W. Trevor King
  2017-06-23 21:30 ` [PATCH v2 5/8] sys-utils/mount.8: Drop systemd paragraph from x-* entry W. Trevor King
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: W. Trevor King @ 2017-06-23 21:30 UTC (permalink / raw)
  To: util-linux; +Cc: Karel Zak, W. Trevor King

Don't try to explain how this happens in isolation, since "unsets any
previous user option", is sufficient.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 sys-utils/mount.8 | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sys-utils/mount.8 b/sys-utils/mount.8
index 26e6ce0..d20e35d 100644
--- a/sys-utils/mount.8
+++ b/sys-utils/mount.8
@@ -1158,8 +1158,7 @@ This option implies the options
 .BR user,exec,dev,suid ).
 .TP
 .B nouser
-Forbid an ordinary user to mount the filesystem.
-This is the default; it does not imply any other options.
+Unset \fBuser\fR.
 .TP
 .B users
 Allow any user to mount and to unmount the filesystem, even
-- 
2.1.0.60.g85f0837


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 5/8] sys-utils/mount.8: Drop systemd paragraph from x-* entry
  2017-06-23 21:30 [PATCH v2 0/8] sys-utils/mount.8: Clarify 'defaults' and separate kernel/userspace options W. Trevor King
                   ` (3 preceding siblings ...)
  2017-06-23 21:30 ` [PATCH v2 4/8] sys-utils/mount.8: Simplify nouser W. Trevor King
@ 2017-06-23 21:30 ` W. Trevor King
  2017-06-27 12:28   ` Karel Zak
  2017-06-23 21:30 ` [PATCH v2 6/8] sys-utils/mount.8: Clarify x-mount.mkdir deprecation W. Trevor King
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 12+ messages in thread
From: W. Trevor King @ 2017-06-23 21:30 UTC (permalink / raw)
  To: util-linux; +Cc: Karel Zak, W. Trevor King

Removing the second paragraph from the x-* entry in favor of a "since
util-linux v2.30" parenthetical.  While the motivation for the
userspace storage is interesting, it's covered in more detail in the
0a14cc8b (libmount: revert X-* and x-* meaning, 2016-12-09) commit
message.

For example, the "keep existing fstab configurations usable" wording
I'm removing was a bit confusing, because fstabs using x-* and
expecting the options to be preserved in userspace were broken before
util-linux v2.30.  The clearer language from 0a14cc8b's commit message
is:

  The systemd and dracut users will get the new (=fixed) functionality
  without a change in fstab configuration.

It's not clear to me if there was an earlier version of util-linux
that also preserved x-* options.  Without that, the existing fstabs
using x-* and intending to have the options preserved *become* usable
with v2.30; they weren't usable before.

Also some minor grammar fixes to the first paragraph.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 sys-utils/mount.8 | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/sys-utils/mount.8 b/sys-utils/mount.8
index d20e35d..2bcb12a 100644
--- a/sys-utils/mount.8
+++ b/sys-utils/mount.8
@@ -1178,17 +1178,13 @@ nor sent to the mount.\fItype\fR helpers nor to the
 system call.  The suggested format is \fBX-\fIappname\fR.\fIoption\fR.
 .TP
 .B x-*
-The same as \fBX-*\fR options, but stored permanently in the user space. It
-means the options are also available for umount or another operations.  Note
-that maintain mount options in user space is tricky, because it's necessary use
-libmount based tools and there is no guarantee that the options will be always
-available (for example after a move mount operation or in unshared namespace).
-
-Note that before util-linux v2.30 the x-* options have not been maintained by
-libmount and stored in user space (functionality was the same as have X-* now),
-but due to growing number of use-cases (in initrd, systemd etc.) the
-functionality have been extended to keep existing fstab configurations usable
-without a change.
+The same as \fBX-*\fR options, but (since util-linux v2.30) stored
+permanently in the user space.  Storing the options means they are
+also available for umount and other operations.  Note that maintaining
+mount options in user space is tricky, because it's necessary use
+libmount-based tools and there is no guarantee that the options will
+be always available (for example after a move mount operation or in an
+unshared namespace).
 .TP
 .BR X-mount.mkdir [ = \fImode\fR ]
 Allow to make a target directory (mountpoint).  The optional argument
-- 
2.1.0.60.g85f0837


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 6/8] sys-utils/mount.8: Clarify x-mount.mkdir deprecation
  2017-06-23 21:30 [PATCH v2 0/8] sys-utils/mount.8: Clarify 'defaults' and separate kernel/userspace options W. Trevor King
                   ` (4 preceding siblings ...)
  2017-06-23 21:30 ` [PATCH v2 5/8] sys-utils/mount.8: Drop systemd paragraph from x-* entry W. Trevor King
@ 2017-06-23 21:30 ` W. Trevor King
  2017-06-23 21:30 ` [PATCH v2 7/8] sys-utils/mount.8: Split filesystem-independent options into kernel and userspace subsections W. Trevor King
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: W. Trevor King @ 2017-06-23 21:30 UTC (permalink / raw)
  To: util-linux; +Cc: Karel Zak, W. Trevor King

The old wording seemed less clear about whether both X- and x- forms
of mount.mkdir were deprecated.  Also:

* Bold x-mount.mkdir so it matches the markup for X-mount.mkdir.
* Prefix "v2.30" with "util-linux" to match the other util-linux
  version references in this man page.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 sys-utils/mount.8 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sys-utils/mount.8 b/sys-utils/mount.8
index 2bcb12a..d5ca65e 100644
--- a/sys-utils/mount.8
+++ b/sys-utils/mount.8
@@ -1192,8 +1192,9 @@ Allow to make a target directory (mountpoint).  The optional argument
 specifies the filesystem access mode used for
 .BR mkdir (2)
 in octal notation.  The default mode is 0755.  This functionality is supported
-only for root users.  The option is also supported as x-mount.mkdir, this notation
-is deprecated for mount.mkdir since v2.30.
+only for root users.  The option is also supported as
+.B x-mount.mkdir\fR,
+but that notation is deprecated since util-linux v2.30.
 
 .SH "FILESYSTEM-SPECIFIC MOUNT OPTIONS"
 The following options apply only to certain filesystems.
-- 
2.1.0.60.g85f0837


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 7/8] sys-utils/mount.8: Split filesystem-independent options into kernel and userspace subsections
  2017-06-23 21:30 [PATCH v2 0/8] sys-utils/mount.8: Clarify 'defaults' and separate kernel/userspace options W. Trevor King
                   ` (5 preceding siblings ...)
  2017-06-23 21:30 ` [PATCH v2 6/8] sys-utils/mount.8: Clarify x-mount.mkdir deprecation W. Trevor King
@ 2017-06-23 21:30 ` W. Trevor King
  2017-06-23 21:30 ` [PATCH v2 8/8] sys-utils/mount.8: Document libmount defaults W. Trevor King
  2017-06-27 12:49 ` [PATCH v2 0/8] sys-utils/mount.8: Clarify 'defaults' and separate kernel/userspace options Karel Zak
  8 siblings, 0 replies; 12+ messages in thread
From: W. Trevor King @ 2017-06-23 21:30 UTC (permalink / raw)
  To: util-linux; +Cc: Karel Zak, W. Trevor King

The filesystem-independent userspace options are useful in fstab.
Separating those options from the filesytem-independent kernel options
avoids distracting folks reading mount(8) while setting up direct
mount(8) calls and similar.  It also makes it easy to punt to mount(2)
for defaults for the kernel-backed options, now that the defaults
entry no longer mentions rw, suid, dev, etc.

The mount(2) default reference also lets us remove "This is the
default" from the diratime entry.  Consistently punting the default
definition to mount(2) is more maintainable than duplicating all of
that mount(2) information locally in mount(8).

While the filesystem-independent userspace options aren't particularly
useful outside of fstab, it's not an error to use them in direct
mount(8) calls.  So the subection is not titled "FSTAB-SPECIFIC MOUNT
OPTIONS" or anything more opinionated.

Also add the previously-undocumentated nogroup, noowner, and nousers
options.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 sys-utils/mount.8 | 108 +++++++++++++++++++++++++++++++-----------------------
 1 file changed, 62 insertions(+), 46 deletions(-)

diff --git a/sys-utils/mount.8 b/sys-utils/mount.8
index d5ca65e..a589f76 100644
--- a/sys-utils/mount.8
+++ b/sys-utils/mount.8
@@ -835,15 +835,16 @@ Display version information and exit.
 Display help text and exit.
 
 .SH FILESYSTEM-INDEPENDENT MOUNT OPTIONS
-Some of these options are only useful when they appear in the
-.I /etc/fstab
-file.
+.SS Generic kernel mount options
 
 Some of these options could be enabled or disabled by default
-in the system kernel.  To check the current setting see the options
-in /proc/mounts.  Note that filesystems also have per-filesystem
-specific default mount options (see for example \fBtune2fs \-l\fP
-output for extN filesystems).
+in the system kernel as documented in
+.BR mount (2).
+To check the current setting see the options in
+.I /proc/mounts\fR.
+Note that filesystems also have per-filesystem specific default mount
+options (see for example \fBtune2fs \-l\fP output for extN
+filesystems).
 
 The following options apply to any filesystem that is being
 mounted (but not every filesystem actually honors them \(en e.g.\&, the
@@ -867,25 +868,6 @@ Do not update inode access times on this filesystem (e.g.\& for faster
 access on the news spool to speed up news servers).  This works for all
 inode types (directories too), so it implies \fB\%nodiratime\fR.
 .TP
-.B auto
-Can be mounted with the
-.B \-a
-option (e.g., at boot time).
-.TP
-.B noauto
-Can only be mounted explicitly (i.e., the
-.B \-a
-option will not cause the filesystem to be mounted).
-.TP
-.B comment=*
-All options prefixed with
-.BR comment=
-are interpreted as comments or as userspace application-specific options.
-These options are not stored in the user space (e.g. mtab file),
-nor sent to the mount.\fItype\fR helpers nor to the
-.BR mount (2)
-system call.  The suggested format is \fBcomment=\fIappname\fR.\fIoption\fR.
-.TP
 .na
 .BR context=\fIcontext ", " fscontext=\fIcontext ", " defcontext=\fIcontext ", and " \%rootcontext=\fIcontext
 .ad
@@ -959,9 +941,6 @@ For more details, see
 .RE
 
 .TP
-.B defaults
-A no-op placeholder with no impact to the filesystem mount options.
-.TP
 .B dev
 Interpret character or block special devices on the filesystem.
 .TP
@@ -970,7 +949,7 @@ Do not interpret character or block special devices on the file
 system.
 .TP
 .B diratime
-Update directory inode access times on this filesystem.  This is the default.
+Update directory inode access times on this filesystem.
 (This option is ignored when \fBnoatime\fR is set.)
 .TP
 .B nodiratime
@@ -990,14 +969,6 @@ Do not permit direct execution of any binaries on the mounted filesystem.
 (Until recently it was possible to run binaries anyway using a command like
 /lib/ld*.so /mnt/binary.  This trick fails since Linux 2.4.25 / 2.6.0.)
 .TP
-.B group
-Allow an ordinary user to mount the filesystem if one
-of that user's groups matches the group of the device.
-This option implies the options
-.BR nosuid " and " nodev
-(unless overridden by subsequent options, as in the option line
-.BR group,dev,suid ).
-.TP
 .B iversion
 Every time the inode is modified, the i_version field will be incremented.
 .TP
@@ -1094,14 +1065,6 @@ Turn on the silent flag.
 .B loud
 Turn off the silent flag.
 .TP
-.B owner
-Allow an ordinary user to mount the filesystem if that
-user is the owner of the device.
-This option implies the options
-.BR nosuid " and " nodev
-(unless overridden by subsequent options, as in the option line
-.BR owner,dev,suid ).
-.TP
 .B remount
 Attempt to remount an already-mounted filesystem.  This is commonly
 used to change the mount flags for a filesystem, especially to make a
@@ -1146,6 +1109,56 @@ Mount the filesystem read-write.
 All I/O to the filesystem should be done synchronously.  In the case of
 media with a limited number of write cycles
 (e.g.\& some flash drives), \fBsync\fR may cause life-cycle shortening.
+
+.SS User-space mount options
+The following filesystem-independent mount options affect the behavior of
+.BR mount (8)
+but are not passed through to the kernel.
+
+.TP
+.B auto
+Can be mounted with the
+.B \-a
+option (e.g., at boot time).
+.TP
+.B noauto
+Can only be mounted explicitly (i.e., the
+.B \-a
+option will not cause the filesystem to be mounted).
+.TP
+.B comment=*
+All options prefixed with
+.BR comment=
+are interpreted as comments or as userspace application-specific options.
+These options are not stored in the userspace (e.g. mtab file),
+nor sent to the mount.\fItype\fR helpers nor to the
+.BR mount (2)
+system call.  The suggested format is \fBcomment=\fIappname\fR.\fIoption\fR.
+.TP
+.B defaults
+A no-op placeholder with no impact to the filesystem mount options.
+.TP
+.B group
+Allow an ordinary user to mount the filesystem if one
+of that user's groups matches the group of the device.
+This option implies the options
+.BR nosuid " and " nodev
+(unless overridden by subsequent options, as in the option line
+.BR group,dev,suid ).
+.TP
+.B nogroup
+Unset \fBgroup\fR.
+.TP
+.B owner
+Allow an ordinary user to mount the filesystem if that
+user is the owner of the device.
+This option implies the options
+.BR nosuid " and " nodev
+(unless overridden by subsequent options, as in the option line
+.BR owner,dev,suid ).
+.TP
+.B noowner
+Unset \fBowner\fR.
 .TP
 .B user
 Allow an ordinary user to mount the filesystem.
@@ -1168,6 +1181,9 @@ This option implies the options
 (unless overridden by subsequent options, as in the option line
 .BR users,exec,dev,suid ).
 .TP
+.B nousers
+Unset \fBusers\fR.
+.TP
 .B X-*
 All options prefixed with
 .BR X-
-- 
2.1.0.60.g85f0837


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 8/8] sys-utils/mount.8: Document libmount defaults
  2017-06-23 21:30 [PATCH v2 0/8] sys-utils/mount.8: Clarify 'defaults' and separate kernel/userspace options W. Trevor King
                   ` (6 preceding siblings ...)
  2017-06-23 21:30 ` [PATCH v2 7/8] sys-utils/mount.8: Split filesystem-independent options into kernel and userspace subsections W. Trevor King
@ 2017-06-23 21:30 ` W. Trevor King
  2017-06-23 22:08   ` W. Trevor King
  2017-06-27 12:49 ` [PATCH v2 0/8] sys-utils/mount.8: Clarify 'defaults' and separate kernel/userspace options Karel Zak
  8 siblings, 1 reply; 12+ messages in thread
From: W. Trevor King @ 2017-06-23 21:30 UTC (permalink / raw)
  To: util-linux; +Cc: Karel Zak, W. Trevor King

For filesystem-independent kernel options (e.g. rw/ro) we're punting
to mount(2).  But these libmount options dare only defined in
util-linux, so we need to document the defaults locally.

Signed-off-by: W. Trevor King <wking@tremily.us>
---
 sys-utils/mount.8 | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/sys-utils/mount.8 b/sys-utils/mount.8
index a589f76..2b03cbe 100644
--- a/sys-utils/mount.8
+++ b/sys-utils/mount.8
@@ -1121,7 +1121,7 @@ Can be mounted with the
 .B \-a
 option (e.g., at boot time).
 .TP
-.B noauto
+.B noauto \fR(default)
 Can only be mounted explicitly (i.e., the
 .B \-a
 option will not cause the filesystem to be mounted).
@@ -1146,7 +1146,7 @@ This option implies the options
 (unless overridden by subsequent options, as in the option line
 .BR group,dev,suid ).
 .TP
-.B nogroup
+.B nogroup \fR(default)
 Unset \fBgroup\fR.
 .TP
 .B owner
@@ -1157,7 +1157,7 @@ This option implies the options
 (unless overridden by subsequent options, as in the option line
 .BR owner,dev,suid ).
 .TP
-.B noowner
+.B noowner \fR(default)
 Unset \fBowner\fR.
 .TP
 .B user
@@ -1170,7 +1170,7 @@ This option implies the options
 (unless overridden by subsequent options, as in the option line
 .BR user,exec,dev,suid ).
 .TP
-.B nouser
+.B nouser \fR(default)
 Unset \fBuser\fR.
 .TP
 .B users
@@ -1181,7 +1181,7 @@ This option implies the options
 (unless overridden by subsequent options, as in the option line
 .BR users,exec,dev,suid ).
 .TP
-.B nousers
+.B nousers \fR(default)
 Unset \fBusers\fR.
 .TP
 .B X-*
-- 
2.1.0.60.g85f0837


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 8/8] sys-utils/mount.8: Document libmount defaults
  2017-06-23 21:30 ` [PATCH v2 8/8] sys-utils/mount.8: Document libmount defaults W. Trevor King
@ 2017-06-23 22:08   ` W. Trevor King
  0 siblings, 0 replies; 12+ messages in thread
From: W. Trevor King @ 2017-06-23 22:08 UTC (permalink / raw)
  To: util-linux; +Cc: Karel Zak

[-- Attachment #1: Type: text/plain, Size: 454 bytes --]

On Fri, Jun 23, 2017 at 02:30:26PM -0700, W. Trevor King wrote:
> to mount(2).  But these libmount options dare only defined in

Typo: s/dare/are/.  I'll fix this in v3, but if you end up picing up
the v2 version of this patch, feel free to fix my commit message
locally.

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 5/8] sys-utils/mount.8: Drop systemd paragraph from x-* entry
  2017-06-23 21:30 ` [PATCH v2 5/8] sys-utils/mount.8: Drop systemd paragraph from x-* entry W. Trevor King
@ 2017-06-27 12:28   ` Karel Zak
  0 siblings, 0 replies; 12+ messages in thread
From: Karel Zak @ 2017-06-27 12:28 UTC (permalink / raw)
  To: W. Trevor King; +Cc: util-linux

On Fri, Jun 23, 2017 at 02:30:23PM -0700, W. Trevor King wrote:
> Removing the second paragraph from the x-* entry in favor of a "since
> util-linux v2.30" parenthetical.  While the motivation for the
> userspace storage is interesting, it's covered in more detail in the
> 0a14cc8b (libmount: revert X-* and x-* meaning, 2016-12-09) commit
> message.
> 
> For example, the "keep existing fstab configurations usable" wording
> I'm removing was a bit confusing, because fstabs using x-* and
> expecting the options to be preserved in userspace were broken before
> util-linux v2.30.  The clearer language from 0a14cc8b's commit message
> is:
> 
>   The systemd and dracut users will get the new (=fixed) functionality
>   without a change in fstab configuration.
> 
> It's not clear to me if there was an earlier version of util-linux
> that also preserved x-* options.  Without that, the existing fstabs
> using x-* and intending to have the options preserved *become* usable
> with v2.30; they weren't usable before.

Before v2.30 the options x-* has been interpreted as pure comment, it
means not stored in userspace (and not available for umount). 

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 0/8] sys-utils/mount.8: Clarify 'defaults' and separate kernel/userspace options
  2017-06-23 21:30 [PATCH v2 0/8] sys-utils/mount.8: Clarify 'defaults' and separate kernel/userspace options W. Trevor King
                   ` (7 preceding siblings ...)
  2017-06-23 21:30 ` [PATCH v2 8/8] sys-utils/mount.8: Document libmount defaults W. Trevor King
@ 2017-06-27 12:49 ` Karel Zak
  8 siblings, 0 replies; 12+ messages in thread
From: Karel Zak @ 2017-06-27 12:49 UTC (permalink / raw)
  To: W. Trevor King; +Cc: util-linux

On Fri, Jun 23, 2017 at 02:30:18PM -0700, W. Trevor King wrote:
> Here's a reroll of May's v1 [1].  Larger changes since v1:
> 
> * Split into multiple patches, something like Karel had suggested [2].
> * Punt to mount(2) for defaults for filesystem-independent kernel
>   options, instead of adding local "(default)" marks.  This is is also
>   something like Karl had suggested in [2].
> * Replaced the broken "synonym for auto" 'defaults' definition which
>   I'd floated in v1 with a line from Karel's earlier suggestion [3].
> * Added two examples to fstab(5) based on Karel's initial suggestions
>   [4] and subsequent discussion.
> * Added a few copy-edit patches.
> 
> After the v1 discussion, I think something should happen to (no)auto
> as well:
> 
> On Tue, May 16, 2017 at 02:41:27PM +0200, Karel Zak wrote [2]:
> > On Fri, May 12, 2017 at 10:36:29AM -0700, W. Trevor King wrote:
> > > > > >    The "default" is interpreted as "auto" by "mount -a".
> > > > >
> > > > > This last line means "defaults" is effectively a synonym for
> > > > > "auto" in fstab, an presumably "auto" would always be
> > > > > preferred (because it more
> > > >
> > > > More precisely, mount -a cares about "noauto" only, everything
> > > > else is "auto".
> > >
> > > Is that really true?  I think:
> > >
> > > * ‘noauto,auto’ means the same thing as a bare ‘auto’.
> >
> > Unfortunately no.
> >
> > It's strange, but "mount -a" search for "noauto" and do not evaluate
> > the options as flags. The libmount follows the original mount(8)
> > with this behavior. I'll try to fix it.
> 
> It's not clear to me whether Karel intends to clarify the mount(8)

It would be better to describe the current behavior. I'm not sure if I
want to fix it :-) 

The problem is that convert all mount options to the flags is relatively 
expensive, and I'm not sure it such change will provide any real
improvement for "mount -a". I guess "noauto,auto" is extremely unusual
setting, the another story is that fstab may be interpreted by another
tools (like systemd), so support this crazy setting will no change
anything in the real world.

It will be better to add to the man page a small note: "noauto" always win
and later specified "auto" does not change it :-)


> current implementation), I'm happy to submit an additional patch.

Please.

>   sys-utils/fstab.5: Remove basic filesystem-independent options
>   sys-utils/fstab.5: Remove 'defaults' from examples
>   sys-utils/mount.8: Document 'defaults' as a no-op
>   sys-utils/mount.8: Simplify nouser
>   sys-utils/mount.8: Drop systemd paragraph from x-* entry
>   sys-utils/mount.8: Clarify x-mount.mkdir deprecation
>   sys-utils/mount.8: Split filesystem-independent options into kernel
>     and userspace subsections
>   sys-utils/mount.8: Document libmount defaults
> 
>  sys-utils/fstab.5 |  38 +++------------
>  sys-utils/mount.8 | 137 +++++++++++++++++++++++++++++++-----------------------
>  2 files changed, 84 insertions(+), 91 deletions(-)

All the patches seems good.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-06-27 12:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-23 21:30 [PATCH v2 0/8] sys-utils/mount.8: Clarify 'defaults' and separate kernel/userspace options W. Trevor King
2017-06-23 21:30 ` [PATCH v2 1/8] sys-utils/fstab.5: Remove basic filesystem-independent options W. Trevor King
2017-06-23 21:30 ` [PATCH v2 2/8] sys-utils/fstab.5: Remove 'defaults' from examples W. Trevor King
2017-06-23 21:30 ` [PATCH v2 3/8] sys-utils/mount.8: Document 'defaults' as a no-op W. Trevor King
2017-06-23 21:30 ` [PATCH v2 4/8] sys-utils/mount.8: Simplify nouser W. Trevor King
2017-06-23 21:30 ` [PATCH v2 5/8] sys-utils/mount.8: Drop systemd paragraph from x-* entry W. Trevor King
2017-06-27 12:28   ` Karel Zak
2017-06-23 21:30 ` [PATCH v2 6/8] sys-utils/mount.8: Clarify x-mount.mkdir deprecation W. Trevor King
2017-06-23 21:30 ` [PATCH v2 7/8] sys-utils/mount.8: Split filesystem-independent options into kernel and userspace subsections W. Trevor King
2017-06-23 21:30 ` [PATCH v2 8/8] sys-utils/mount.8: Document libmount defaults W. Trevor King
2017-06-23 22:08   ` W. Trevor King
2017-06-27 12:49 ` [PATCH v2 0/8] sys-utils/mount.8: Clarify 'defaults' and separate kernel/userspace options Karel Zak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.