]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
mount.2: Revise description of MS_REMOUNT | MS_BIND
authorNeilBrown <neilb@suse.com>
Fri, 19 May 2017 06:55:34 +0000 (16:55 +1000)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Sun, 21 May 2017 09:53:13 +0000 (11:53 +0200)
MS_REMOUNT|MS_BIND affect all per-mount-point
flag.  MS_RDONLY is only special because it,
uniquely, is both a per-mount-point flag *and* a
per-filesystem flag.

So the sections of per-mount-point flags and
MS_REMOUNT can usefully be clarified.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man2/mount.2

index 35fdda084d61739fb7674de487d0e1e2cde9f8c9..3e5348368757e00da3addbafc475259b48aa2293 100644 (file)
@@ -288,6 +288,12 @@ are also settable on a per-mount-point basis.
 The
 .B MS_RELATIME
 flag is also settable on a per-mount-point basis.
+Since Linux 2.6.16,
+.B MS_RDONLY
+can be set or cleared on a per-mount-point basis as well as on
+the underlying filesystem.  The mounted filesystem will only be
+writable if neither the filesystem nor the mountpoint are flagged as
+read-only.
 .\"
 .SS Remounting an existing mount
 An existing mount may be remounted by specifying
@@ -317,6 +323,10 @@ and
 arguments should match the values used in the original
 .BR mount ()
 call, except for those parameters that are being deliberately changed.
+Another exception is that
+.B MS_BIND
+has a different meaning for remount, and it should only be included if
+explicitly desired.
 
 The following
 .I mountflags
@@ -351,17 +361,20 @@ then the remount operation preserves the existing values of these flags
 (rather than defaulting to
 .BR MS_RELATIME ).
 
-Since Linux 2.6.26, this flag can also be used to make
+Since Linux 2.6.26, this flag can be used with
+.B MS_BIND
+to only modify the per-mount-point flags.
 .\" See https://lwn.net/Articles/281157/
-an existing bind mount read-only by specifying
+This is particularly useful for setting or clearing the "read-only"
+flag on a mount point without changing the underlying filesystem.
+Specifying
 .IR mountflags
 as:
 
     MS_REMOUNT | MS_BIND | MS_RDONLY
 
-Note that only the
-.BR MS_RDONLY
-setting of the bind mount can be changed in this manner.
+will make access through this mountpoint read-only, without affecting
+other mount points.
 .\"
 .SS Creating a bind mount
 If