Re: [PATCH v5 7/8] man/man2/open_tree{,_attr}.2: document new open_tree_attr() API

Alejandro Colomar
2025-10-01T18:02:21Z

[-- Attachment #1: Type: text/plain, Size: 2086 bytes --]

Hi Aleksa,

On Wed, Oct 01, 2025 at 05:35:45PM +1000, Aleksa Sarai wrote:
> On 2025-10-01, Askar Safin <safinaskar@gmail.com> wrote:
> > Aleksa Sarai <cyphar@cyphar.com>:
> > > +mntfd2 = open_tree(mntfd1, "", OPEN_TREE_CLONE,
> > > + &attr, sizeof(attr));
> >
> > Your whole so-called "open_tree_attr example" doesn't contain any open_tree_attr
> > calls. :)
> >
> > I think you meant open_tree_attr here.
>
> Oops.
>
> >
> > > +\&
> > > +/* Create a new copy with the id-mapping cleared */
> > > +memset(&attr, 0, sizeof(attr));
> > > +attr.attr_clr = MOUNT_ATTR_IDMAP;
> > > +mntfd3 = open_tree(mntfd1, "", OPEN_TREE_CLONE,
> > > + &attr, sizeof(attr));
> >
> > And here.
>
> Oops x2.
>
> > Otherwise your whole patchset looks good. Add to whole patchset:
> > Reviewed-by: Askar Safin <safinaskar@gmail.com>

I've applied the patch, with the following amendment:

diff --git i/man/man2/open_tree.2 w/man/man2/open_tree.2
index 8b48f3b78..f6f2fbecd 100644
--- i/man/man2/open_tree.2
+++ w/man/man2/open_tree.2
@@ -683,14 +683,14 @@ .SS open_tree_attr()
.\" Using .attr_clr is not strictly necessary but makes the intent clearer.
attr.attr_set = MOUNT_ATTR_IDMAP;
attr.userns_fd = nsfd2;
-mntfd2 = open_tree(mntfd1, "", OPEN_TREE_CLONE,
- &attr, sizeof(attr));
+mntfd2 = open_tree_attr(mntfd1, "", OPEN_TREE_CLONE,
+ &attr, sizeof(attr));
\&
/* Create a new copy with the id-mapping cleared */
memset(&attr, 0, sizeof(attr));
attr.attr_clr = MOUNT_ATTR_IDMAP;
-mntfd3 = open_tree(mntfd1, "", OPEN_TREE_CLONE,
- &attr, sizeof(attr));
+mntfd3 = open_tree_attr(mntfd1, "", OPEN_TREE_CLONE,
+ &attr, sizeof(attr));
.EE
.in
.P

(Hopefully I got it right.)

Cheers,
Alex

>
> --
> Aleksa Sarai
> Senior Software Engineer (Containers)
> SUSE Linux GmbH
> https://www.cyphar.com/

--
<https://www.alejandro-colomar.es>
Use port 80 (that is, <...:80/>).

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]