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

Aleksa Sarai
2025-10-03T04:22:35Z

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

On 2025-10-01, Alejandro Colomar <alx@kernel.org> wrote:
> 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.)

That looks correct -- thanks!

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

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