Linux Test Project
 help / color / mirror / Atom feed
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 20:26:43 +0000	[thread overview]
Message-ID: <20260601202643.3970-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260601165331.4077251-1-chihsheng@google.com>

Hi Darren,

Thank you for the patch. The approach is sound: using a runtime probe in
setup() to detect a backported feature is the correct LTP pattern when a
version check alone is insufficient. One issue needs fixing before merging.

---

syscalls/xattr: Add runtime probe for socket xattr backports

Commit message: OK

> diff --git a/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c b/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c

Lines 8-26 (/*\ description comment, not changed by the patch):

  /*\
   * ...
   * - Set attribute to a UNIX domain socket, fsetxattr(2) should
   *   return -1 and set errno to EPERM on kernels < 7.1.0.
   *   On kernel 7.1.0+ (dc0876b9846d "xattr: support extended
   *   attributes on sockets"), returns 0 (success) as sockets now
   *   support user.* xattrs.
   */

The patch changes the socket test-case behavior for kernels < 7.1.0 with
the backport, but does not update this description. After the patch there
are three outcomes for the socket case:

  - kernel < 7.1.0, no backport     → EPERM
  - kernel < 7.1.0, backport present → 0 (success, detected by probe)
  - kernel >= 7.1.0                  → 0 (success)

The comment currently describes only the first and third case. Please
update it to mention the runtime probe for backported kernels. For
example:

  * - Set attribute to a UNIX domain socket, fsetxattr(2) should
  *   return -1 and set errno to EPERM on kernels < 7.1.0, unless the
  *   feature is detected at runtime (e.g. backport). On kernel 7.1.0+
  *   (dc0876b9846d "xattr: support extended attributes on sockets"),
  *   or when the backport is probed in setup(), returns 0 (success).

Note: setxattr02.c uses "EPERM/SUCCEED" in its description which is
already open-ended; no change is needed there.

> +       int socket_idx = -1;
> ...
> +               for (i = 0; i < ARRAY_SIZE(tc); i++) {
> +                       if (tc[i].issocket) {
> +                               socket_idx = i;

Nit: `socket_idx` is `int` but assigned from `size_t i`. Not a runtime
problem here (small array), but declaring it as `size_t socket_idx` with
`ARRAY_SIZE(tc)` as the "not found" sentinel would avoid the implicit
narrowing. If you keep `int`, that is also acceptable given the tiny
array size.

> diff --git a/testcases/kernel/syscalls/setxattr/setxattr02.c b/testcases/kernel/syscalls/setxattr/setxattr02.c

New probe code: OK. Clean and straightforward.

---

Verdict: Needs revision 🔴

The description comment in fsetxattr02.c must be updated to reflect the
three possible outcomes for the socket test case. Everything else is
correct.

LTP AI Reviewer

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2026-06-01 20:27 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 ` [LTP] " linuxtestproject.agent
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   ` linuxtestproject.agent [this message]
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=20260601202643.3970-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