From: Amir Goldstein <amir73il@gmail.com>
To: Alejandro Colomar <alx.manpages@gmail.com>
Cc: linux-man@vger.kernel.org
Subject: [PATCH v3 2/2] name_to_handle_at.2: Document the AT_HANDLE_CONNECTABLE flag
Date: Mon, 31 Mar 2025 10:16:42 +0200 [thread overview]
Message-ID: <20250331081642.1423812-2-amir73il@gmail.com> (raw)
In-Reply-To: <20250331081642.1423812-1-amir73il@gmail.com>
A flag since v6.13 to indicate that the requested file_handle is
intended to be used for open_by_handle_at(2) to obtain an open file
with a known path.
Cc: Chuck Lever <chuck.lever@oracle.com>
Cc: Jeff Layton <jlayton@poochiereds.net>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
man/man2/open_by_handle_at.2 | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/man/man2/open_by_handle_at.2 b/man/man2/open_by_handle_at.2
index e3ec70dd5..f808ea933 100644
--- a/man/man2/open_by_handle_at.2
+++ b/man/man2/open_by_handle_at.2
@@ -128,6 +128,7 @@ The
argument is a bit mask constructed by ORing together zero or more of
.BR AT_HANDLE_FID ,
.BR AT_HANDLE_MNT_ID_UNIQUE,
+.BR AT_HANDLE_CONNECTABLE,
.BR AT_EMPTY_PATH ,
and
.BR AT_SYMLINK_FOLLOW ,
@@ -163,6 +164,29 @@ with the
.BR STATX_MNT_ID_UNIQUE
flag.
.P
+When
+.I flags
+contain the
+.BR AT_HANDLE_CONNECTABLE " (since Linux 6.13)"
+.\" commit a20853ab8296d4a8754482cb5e9adde8ab426a25
+flag, the caller indicates that the returned
+.I file_handle
+is needed to open a file with known path later,
+so it should be expected that a subsequent call to
+.BR open_by_handle_at ()
+with the returned
+.I file_handle
+may fail if the file was moved,
+but otherwise,
+the path of the opened file is expected to be visible
+from the
+.IR /proc/ pid /fd/ *
+magic link.
+This flag can not be used in combination with the flags
+.B AT_HANDLE_FID
+and/or
+.BR AT_EMPTY_PATH .
+.P
Together, the
.I pathname
and
@@ -327,7 +351,7 @@ points outside your accessible address space.
.TP
.B EINVAL
.I flags
-includes an invalid bit value.
+includes an invalid bit value or an invalid bit combination.
.TP
.B EINVAL
.I handle\->handle_bytes
@@ -414,6 +438,11 @@ was acquired using the
.B AT_HANDLE_FID
flag and the filesystem does not support
.BR open_by_handle_at ().
+This error can also occur if the
+.I handle
+was acquired using the
+.B AT_HANDLE_CONNECTABLE
+flag and the file was moved to a different parent.
.SH VERSIONS
FreeBSD has a broadly similar pair of system calls in the form of
.BR getfh ()
--
2.34.1
next prev parent reply other threads:[~2025-03-31 8:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-31 8:16 [PATCH v3 1/2] name_to_handle_at.2: Document the AT_HANDLE_MNT_ID_UNIQUE flag Amir Goldstein
2025-03-31 8:16 ` Amir Goldstein [this message]
2025-03-31 8:45 ` [PATCH v3 2/2] name_to_handle_at.2: Document the AT_HANDLE_CONNECTABLE flag Alejandro Colomar
2025-03-31 8:38 ` [PATCH v3 1/2] name_to_handle_at.2: Document the AT_HANDLE_MNT_ID_UNIQUE flag Alejandro Colomar
2025-03-31 9:37 ` Amir Goldstein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250331081642.1423812-2-amir73il@gmail.com \
--to=amir73il@gmail.com \
--cc=alx.manpages@gmail.com \
--cc=linux-man@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox