* [PATCH] mount.2: revise description of MS_REMOUNT | MS_BIND
@ 2017-05-19 6:55 NeilBrown
[not found] ` <87zie9jpy1.fsf-wvvUuzkyo1HefUI2i7LXDhCRmIWqnp/j@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: NeilBrown @ 2017-05-19 6:55 UTC (permalink / raw)
To: mtk.manpages; +Cc: linux-man, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2221 bytes --]
MS_REMOUNT|MS_BIND affect all per-mount-point
flag. MS_READONLY 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>
---
man2/mount.2 | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/man2/mount.2 b/man2/mount.2
index 35fdda084d61..3e5348368757 100644
--- a/man2/mount.2
+++ b/man2/mount.2
@@ -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
--
2.12.2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mount.2: revise description of MS_REMOUNT | MS_BIND
[not found] ` <87zie9jpy1.fsf-wvvUuzkyo1HefUI2i7LXDhCRmIWqnp/j@public.gmane.org>
@ 2017-05-22 11:43 ` Michael Kerrisk (man-pages)
0 siblings, 0 replies; 2+ messages in thread
From: Michael Kerrisk (man-pages) @ 2017-05-22 11:43 UTC (permalink / raw)
To: NeilBrown
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
linux-man-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
On 05/19/2017 08:55 AM, NeilBrown wrote:
>
> MS_REMOUNT|MS_BIND affect all per-mount-point
> flag. MS_READONLY 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-IBi9RG/b67k@public.gmane.org>
Thanks, Neil. Applied.
Cheers,
Michael
> ---
> man2/mount.2 | 23 ++++++++++++++++++-----
> 1 file changed, 18 insertions(+), 5 deletions(-)
>
> diff --git a/man2/mount.2 b/man2/mount.2
> index 35fdda084d61..3e5348368757 100644
> --- a/man2/mount.2
> +++ b/man2/mount.2
> @@ -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
>
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-22 11:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-19 6:55 [PATCH] mount.2: revise description of MS_REMOUNT | MS_BIND NeilBrown
[not found] ` <87zie9jpy1.fsf-wvvUuzkyo1HefUI2i7LXDhCRmIWqnp/j@public.gmane.org>
2017-05-22 11:43 ` Michael Kerrisk (man-pages)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox