Hello,

This is a patch for systemd, so the title should start with "systemd:".

On Wed Sep 2, 2026 at 12:24 PM CEST, Suresh H A via lists.openembedded.org 
wrote:
> From: Suresh H A <[email protected]>
>
> Backport a fix to try AT_EMPTY_PATH for access_fd() first

What issue does this patch fix?

> Fix is already available since systemd v257-rc1.
>
> Signed-off-by: Suresh H A <[email protected]>
> ---
>  ...ry-AT_EMPTY_PATH-for-access_fd-first.patch | 37 +++++++++++++++++++
>  meta/recipes-core/systemd/systemd_255.21.bb   |  1 +
>  2 files changed, 38 insertions(+)
>  create mode 100644 
> meta/recipes-core/systemd/systemd/0023-fs-util-try-AT_EMPTY_PATH-for-access_fd-first.patch
>
> diff --git 
> a/meta/recipes-core/systemd/systemd/0023-fs-util-try-AT_EMPTY_PATH-for-access_fd-first.patch
>  
> b/meta/recipes-core/systemd/systemd/0023-fs-util-try-AT_EMPTY_PATH-for-access_fd-first.patch
> new file mode 100644
> index 0000000000..29dd86c850
> --- /dev/null
> +++ 
> b/meta/recipes-core/systemd/systemd/0023-fs-util-try-AT_EMPTY_PATH-for-access_fd-first.patch
> @@ -0,0 +1,37 @@
> +From 55453c9671934fc7ee369788eb0a1a9c8c850e8f Mon Sep 17 00:00:00 2001
> +From: Mike Yuan <[email protected]>
> +Date: Mon, 20 May 2024 19:33:26 +0800
> +Subject: [PATCH] fs-util: try AT_EMPTY_PATH for access_fd() first
> +
> +Upstream-Status: Backport
> +[https://github.com/systemd/systemd/pull/32933/commits/c675851d5fd503c1ae5d244f041d43ae9e3ab79b]
Please don't split the line here.

This patch comes from a PR titled "fs-util: several cleanups": Cleanups
are not usually acceptable on stables. You will need to argue why we
need to merge this patch.

> +Comment: Patch is refreshed as per codebase of v255

I don't see any change with upstream. No need to add a comment like this
if there is no meaningful change.

> +Signed-off-by: Suresh H A <[email protected]>
> +---
> + src/basic/fs-util.c | 8 ++++++++
> + 1 file changed, 8 insertions(+)
> +
> +diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c
> +index ee38e0266a..0f65af1a07 100644
> +--- a/src/basic/fs-util.c
> ++++ b/src/basic/fs-util.c
> +@@ -664,6 +664,14 @@ int unlink_or_warn(const char *filename) {
> + int access_fd(int fd, int mode) {
> +         /* Like access() but operates on an already open fd */
> + 
> ++        if (faccessat(fd, "", mode, AT_EMPTY_PATH) >= 0)
> ++                return 0;
> ++        if (errno != EINVAL)
> ++                return -errno;
> ++
> ++        /* Support for AT_EMPTY_PATH is added rather late (kernel 5.8), so 
> fall back to going through /proc/
> ++         * if unavailable. */
> ++
> +         if (access(FORMAT_PROC_FD_PATH(fd), mode) < 0) {
> +                 if (errno != ENOENT)
> +                         return -errno;

You can either:
- send a v2 with the missing justification for merging the patch
- discuss it here first.

Thanks,
-- 
Yoann Congal
Smile ECS

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#246406): 
https://lists.openembedded.org/g/openembedded-core/message/246406
Mute This Topic: https://lists.openembedded.org/mt/121049823/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to