[LTP] semctl01: fix SEM_STAT failures under parallel LTP runs
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Thu Jul 30 18:00:14 CEST 2026
Hi Stephen,
On Thu, Jul 30, 2026, Stephen Bertram wrote:
> semctl01: fix SEM_STAT failures under parallel LTP runs
The functional change looks correct: looking up this test's own kernel
index instead of relying on the global high index from IPC_INFO is the
right fix, the shared get_ipc_idx_from_id() helper faithfully preserves
the old shmctl01 loop, and the non-SAFE stat() wrappers correctly skip
foreign sets that return -1. Two small comments below.
> +int get_ipc_idx_from_id(int id, int max_idx,
> + int (*stat_fn)(int idx, void *buf), void *buf);
Could this new public function gain a kernel-doc comment? Per the
documentation rules new public functions in include/ should be
documented with kernel-doc. The rest of this header is undocumented
too, so this is only a suggestion.
Also, the continuation line here is indented with three tabs plus one
extra space, so it does not align with the open parenthesis. The
definition in tse_newipc.c aligns with three tabs and no extra space;
should the declaration match?
> +static void func_sstat(int semid)
> +{
> + if (semid != sem_id) {
> + tst_res(TFAIL, "expected sem_id %d, got %d", sem_id, semid);
> + return;
> + }
> +
> + if (buf.sem_nsems == PSEMS && buf.sem_perm.mode == (SEM_RA | NEWMODE))
This reads the mode set by the IPC_SET case. Since the SEM_STAT case
(index 11) always runs after IPC_SET (index 1) in the tcases array, and
the mode is not touched in between, buf.sem_perm.mode is 0666 as
asserted here - so the check holds. Just noting the dependency for the
record.
Verdict - Needs revision
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
More information about the ltp
mailing list