Re: [PATCH 1/2] Add manpages for move_mount(2) and open_tree(2)

2019-10-10 Thread David Howells
Michael Kerrisk (man-pages)  wrote:

> [MANPAGE] fsopen.2, fsmount.2
> [MANPAGE] fspick.2
> [MANPAGE] fsconfig.2
> [MANPAGE] open_tree.2
> [MANPAGE] move_mount.2

Those were really aimed at non-doccy people to have a look over without
needing to apply the patch or strip the diff metadata.

Roff is hard enough to read as it is ;-)

> [PATCH 1/2] Add manpages for move_mount(2) and open_tree(2)
> [PATCH 2/2] Add manpage for fsopen(2), fspick(2) and fsmount(2)

Those were aimed specifically at you.

If it's okay with you, I'll wait a bit before splitting and resending the
patches, just in case anyone points out any problems.

David


Re: [PATCH 1/2] Add manpages for move_mount(2) and open_tree(2)

2019-10-10 Thread Michael Kerrisk (man-pages)
Hello David,

I got a bunch of mail with man-pages patches from you,
but I think there's some confusion, since the mails I
got were:

[MANPAGE] fsopen.2, fsmount.2
[MANPAGE] fspick.2
[MANPAGE] fsconfig.2
[MANPAGE] open_tree.2
[MANPAGE] move_mount.2
[PATCH 1/2] Add manpages for move_mount(2) and open_tree(2)
[PATCH 2/2] Add manpage for fsopen(2), fspick(2) and fsmount(2)

There are two problems here:
(1) There's obviously some duplication in the mails,
so I don't know which ones to detail with.
(2) Some of the mails still provide two man pages in one mail.
This would make review very difficult.

Could you resend please? One patch per page (and no duplicates).

Also, I greatly appreciate you CCing linux-kernel@ and
linux-fsdevel@, so that there might be wider exposure for
review, but could you also CC linux-man@ please.

Thanks,

Michael

On 10/10/19 7:05 PM, David Howells wrote:
> Add manual pages to document the move_mount and open_tree() system calls.
> 
> Signed-off-by: David Howells 
> ---
> 
>  man2/move_mount.2 |  275 
> +
>  man2/open_tree.2  |  260 ++
>  2 files changed, 535 insertions(+)
>  create mode 100644 man2/move_mount.2
>  create mode 100644 man2/open_tree.2
> 
> diff --git a/man2/move_mount.2 b/man2/move_mount.2
> new file mode 100644
> index 0..a9720ea6f
> --- /dev/null
> +++ b/man2/move_mount.2
> @@ -0,0 +1,275 @@
> +'\" t
> +.\" Copyright (c) 2019 David Howells 
> +.\"
> +.\" %%%LICENSE_START(VERBATIM)
> +.\" Permission is granted to make and distribute verbatim copies of this
> +.\" manual provided the copyright notice and this permission notice are
> +.\" preserved on all copies.
> +.\"
> +.\" Permission is granted to copy and distribute modified versions of this
> +.\" manual under the conditions for verbatim copying, provided that the
> +.\" entire resulting derived work is distributed under the terms of a
> +.\" permission notice identical to this one.
> +.\"
> +.\" Since the Linux kernel and libraries are constantly changing, this
> +.\" manual page may be incorrect or out-of-date.  The author(s) assume no
> +.\" responsibility for errors or omissions, or for damages resulting from
> +.\" the use of the information contained herein.  The author(s) may not
> +.\" have taken the same level of care in the production of this manual,
> +.\" which is licensed free of charge, as they might when working
> +.\" professionally.
> +.\"
> +.\" Formatted or processed versions of this manual, if unaccompanied by
> +.\" the source, must acknowledge the copyright and authors of this work.
> +.\" %%%LICENSE_END
> +.\"
> +.TH MOVE_MOUNT 2 2019-10-10 "Linux" "Linux Programmer's Manual"
> +.SH NAME
> +move_mount \- Move mount objects around the filesystem topology
> +.SH SYNOPSIS
> +.nf
> +.B #include 
> +.br
> +.B #include 
> +.br
> +.B #include 
> +.br
> +.BR "#include" "/* Definition of AT_* constants */"
> +.PP
> +.BI "int move_mount(int " from_dirfd ", const char *" from_pathname ","
> +.BI "   int " to_dirfd ", const char *" to_pathname ","
> +.BI "   unsigned int " flags );
> +.fi
> +.PP
> +.IR Note :
> +There is no glibc wrapper for this system call.
> +.SH DESCRIPTION
> +The
> +.BR move_mount ()
> +call moves a mount from one place to another; it can also be used to attach 
> an
> +unattached mount created by
> +.BR fsmount "() or " open_tree "() with " OPEN_TREE_CLONE .
> +.PP
> +If
> +.BR move_mount ()
> +is called repeatedly with a file descriptor that refers to a mount object,
> +then the object will be attached/moved the first time and then moved again 
> and
> +again and again, detaching it from the previous mountpoint each time.
> +.PP
> +To access the source mount object or the destination mountpoint, no
> +permissions are required on the object itself, but if either pathname is
> +supplied, execute (search) permission is required on all of the directories
> +specified in
> +.IR from_pathname " or " to_pathname .
> +.PP
> +The caller does, however, require the appropriate capabilities or permission
> +to effect a mount.
> +.PP
> +.BR move_mount ()
> +uses
> +.IR from_pathname ", " from_dirfd " and part of " flags
> +to locate the mount object to be moved and
> +.IR to_pathname ", " to_dirfd " and another part of " flags
> +to locate the destination mountpoint.  Each lookup can be done in one of a
> +variety of ways:
> +.TP
> +[*] By absolute path.
> +The pathname points to an absolute path and the dirfd is ignored.  The file 
> is
> +looked up by name, starting from the root of the filesystem as seen by the
> +calling process.
> +.TP
> +[*] By cwd-relative path.
> +The pathname points to a relative path and the dirfd is
> +.IR AT_FDCWD .
> +The file is looked up by name, starting from the current working directory.
> +.TP
> +[*] By dir-relative path.
> +The pathname points to relative path and the dirfd indicates a file 
> descriptor
>