Re: [PATCH v5] semctl01: tolerate SEM_STAT races under parallel LTP runs
Andrea Cervesato via ltp <[email protected]> Tue, 28 Jul 2026 13:06:14 +0000
| Newsgroups | gmane.linux.ltp |
|---|---|
| Message-ID | <[email protected]> |
Hi Stephen,
> +/*
> + * SEM_STAT takes an ipc idr index. Under parallel IPC tests that index can
> + * vanish between IPC_INFO and SEM_STAT (EIDRM/EINVAL). Refresh and retry.
> + */
> +static int do_sem_stat(union semun arg)
> +{
> + int idx;
> + unsigned int retries = 5;
> +
> + do {
> + int info_id = 0;
> +
> + idx = SAFE_SEMCTL(info_id, 0, IPC_INFO, (union semun)&ipc_buf);
> + TEST(semctl(idx, 0, SEM_STAT, arg));
> + if (TST_RET >= 0)
> + return TST_RET;
> + if (TST_ERR != EIDRM && TST_ERR != EINVAL)
> + tst_brk(TBROK | TERRNO, "semctl(SEM_STAT)");
> + } while (--retries);
> +
> + tst_brk(TBROK | TERRNO, "semctl(SEM_STAT) still failing after retries");
> + return -1;
> +}
> +
In LTP we have TST_RETRY_FUNC/TST_RETRY_FN_EXP_BACKOFF, please use
this one instead.
Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato-IBi9RG/[email protected]
--
Mailing list info: https://lists.linux.it/listinfo/ltp