From: linuxtestproject.agent@gmail.com
To: Darren Chang <chihsheng@google.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] syscalls/xattr: Add runtime probe for socket xattr backports
Date: Mon, 1 Jun 2026 13:35:18 +0000 [thread overview]
Message-ID: <20260601133518.3966-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260601101302.3858362-1-chihsheng@google.com>
Hi Darren,
Thank you for this patch. The approach is sound: a runtime probe for
backported socket xattr support is the right way to avoid false
failures on downstream kernels. However there are a few issues in
fsetxattr02.c that need fixing before this can be applied.
Verdict: Needs revision
---
[1] fsetxattr02.c — variable declared after executable statement
The new `int socket_idx = -1;` declaration appears after the
executable statement `socket_xattr_supported = tst_kvercmp(7, 1, 0)
>= 0;`. The existing setup() declares all its local variables at the
top of the function (`size_t i = 0;` etc.). This new variable must
follow the same convention.
Move `int socket_idx = -1;` to the top of setup(), alongside the
existing declarations:
static void setup(void)
{
size_t i = 0;
int socket_idx = -1; /* add here */
struct sockaddr_un sun;
...
[2] fsetxattr02.c — indentation uses spaces instead of tabs
The `int socket_idx = -1;` line in the patch uses 4 spaces for
indentation instead of a tab character:
- int socket_idx = -1; /* 4 spaces — wrong */
+ int socket_idx = -1; /* tab — correct */
The rest of the function uses tabs throughout.
[3] fsetxattr02.c — comment doesn't reference the upstream commit
The comment added to fsetxattr02.c is vague compared to the one added
to setxattr02.c, which names the upstream commit and its title:
setxattr02.c (new):
/*
* Commit dc0876b9846d "xattr: support extended attributes on sockets"
* merged in 7.1.0 mainline, but might be backported.
* Try to set xattr on socket to detect support.
*/
fsetxattr02.c (new):
/*
* Probe for backports on older kernels.
* If the version is < 7.1.0 but fsetxattr() succeeds, we assume the patch
* has been backported.
*/
These describe the same feature. The fsetxattr02 comment should
include the commit reference for consistency. Use the same wording as
in setxattr02.c.
[4] fsetxattr02.c — inline comment is unnecessary
/* Clean up the probed xattr to avoid interfering with the actual test */
SAFE_FREMOVEXATTR(tc[socket_idx].fd, tc[socket_idx].key);
The comment states the obvious. SAFE_FREMOVEXATTR after a successful
setxattr-probe speaks for itself. Drop it, matching the style of the
equivalent block in setxattr02.c which has no such comment.
---
Aside from those four points the logic is correct. In particular:
- setxattr02.c looks clean; no issues there.
- The probe correctly uses the already-opened socket fd in fsetxattr02,
mirroring the path-based probe in setxattr02.
- Silently ignoring non-zero probe results is correct: EPERM means no
backport, and EOPNOTSUPP is caught later in verify_fsetxattr().
- `socket_xattr_supported = true` (using bool) is consistent with the
field type (`static bool socket_xattr_supported`).
- The commit message is accurate and the Signed-off-by is present.
---
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-06-01 13:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-01 10:13 [LTP] [PATCH] syscalls/xattr: Add runtime probe for socket xattr backports Darren Chang via ltp
2026-06-01 13:35 ` linuxtestproject.agent [this message]
2026-06-01 15:14 ` [LTP] [PATCH v2] " Darren Chang via ltp
2026-06-01 16:03 ` [LTP] " linuxtestproject.agent
2026-06-01 16:53 ` [LTP] [PATCH v3] " Darren Chang via ltp
2026-06-01 20:26 ` [LTP] " linuxtestproject.agent
2026-06-02 1:07 ` [LTP] [PATCH v4] " Darren Chang via ltp
2026-06-02 4:06 ` [LTP] " linuxtestproject.agent
2026-06-03 10:34 ` [LTP] [PATCH v4] " Cyril Hrubis
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=20260601133518.3966-1-linuxtestproject.agent@gmail.com \
--to=linuxtestproject.agent@gmail.com \
--cc=chihsheng@google.com \
--cc=ltp@lists.linux.it \
/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