Thread (5 messages) 5 messages, 2 authors, 2025-08-26

[PATCH v2 1/1] man2/mount.2: expand and clarify docs for MS_REMOUNT | MS_BIND

From: Askar Safin <hidden>
Date: 2025-08-25 15:49:46
Also in: linux-api, linux-man
Subsystem: the rest · Maintainer: Linus Torvalds

My edit is based on experiments and reading Linux code

Signed-off-by: Askar Safin <redacted>
---
 man/man2/mount.2 | 32 +++++++++++++++++++++++++++++---
 1 file changed, 29 insertions(+), 3 deletions(-)
diff --git a/man/man2/mount.2 b/man/man2/mount.2
index 5d83231f9..47fc2d21f 100644
--- a/man/man2/mount.2
+++ b/man/man2/mount.2
@@ -405,7 +405,30 @@ flag can be used with
 to modify only the per-mount-point flags.
 .\" See https://lwn.net/Articles/281157/
 This is particularly useful for setting or clearing the "read-only"
-flag on a mount without changing the underlying filesystem.
+flag on a mount without changing the underlying filesystem parameters.
+The
+.I data
+argument is ignored if
+.B MS_REMOUNT
+and
+.B MS_BIND
+are specified.
+Note that the mountpoint will
+have its existing per-mount-point flags
+cleared and replaced with those in
+.I mountflags
+when
+.B MS_REMOUNT
+and
+.B MS_BIND
+are specified.
+This means that if
+you wish to preserve
+any existing per-mount-point flags,
+you need to include them in
+.IR mountflags ,
+along with the per-mount-point flags you wish to set
+(or with the flags you wish to clear missing).
 Specifying
 .I mountflags
 as:
@@ -416,8 +439,11 @@ MS_REMOUNT | MS_BIND | MS_RDONLY
 .EE
 .in
 .P
-will make access through this mountpoint read-only, without affecting
-other mounts.
+will make access through this mountpoint read-only
+(clearing all other per-mount-point flags),
+without affecting
+other mounts
+of this filesystem.
 .\"
 .SS Creating a bind mount
 If
-- 
2.47.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help