Thread (27 messages) 27 messages, 3 authors, 2025-10-26

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

From: Aleksa Sarai <hidden>
Date: 2025-10-03 04:22:35
Also in: linux-fsdevel, linux-man, lkml

On 2025-10-01, Alejandro Colomar [off-list ref] wrote:
Hi Aleksa,

On Wed, Oct 01, 2025 at 05:35:45PM +1000, Aleksa Sarai wrote:
quoted
On 2025-10-01, Askar Safin [off-list ref] wrote:
quoted
Aleksa Sarai [off-list ref]:
quoted
+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.
quoted
quoted
+\&
+/* 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.
quoted
Otherwise your whole patchset looks good. Add to whole patchset:
Reviewed-by: Askar Safin <redacted>
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/

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help