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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Askar,

On Mon, Aug 25, 2025 at 03:48:39PM +0000, Askar Safin wrote:
> My edit is based on experiments and reading Linux code
> 
> Signed-off-by: Askar Safin <safinaskar@xxxxxxxxxxxx>
> ---
>  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

I would remove "Note that".  Starting with "The" already is equally
meaningful, and two less meaningless words for the reader.

Should we say "mount point" instead?  Otherwise, it's inconsistent with
"mount-point flags" below.  Also, see:

alx@debian:~/src/linux/man-pages/man-pages/master/man$ grep -rn 'mount point' | wc -l
98
alx@debian:~/src/linux/man-pages/man-pages/master/man$ grep -rn 'mountpoint' | wc -l
3


> +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.

Maybe reverse the sentence to start with this?

	When
	.B MS_REMOUNT
	and
	.B MS_BIND
	are specified,
	the ...
	will have its existing ...
	cleared and replaced with those in
	.IR mountflags .

Having conditionals at the end makes my brain have to reparse the
previous text to understand it.  If I read the conditional early on,
my branch predictor kind of knows what to expect.  :)

> +This means that if

I would move the 'if' to the next line.

> +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.

Hmmm, I see this uses 'mountpoint' already.

I guess we should have a clear direction of what term we want to use.
Since the existing text already uses this, I think we should change it
in a separate commit.  Do you want to send a second patch to use
'mount point'?

> +will make access through this mountpoint read-only
> +(clearing all other per-mount-point flags),
> +without affecting
> +other mounts
> +of this filesystem.


Have a lovely night!
Alex

>  .\"
>  .SS Creating a bind mount
>  If
> -- 
> 2.47.2
> 

-- 
<https://www.alejandro-colomar.es/>

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux