[LTP] fanotify13: fix test failure when running iterations
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Thu May 28 18:03:12 CEST 2026
Hi Amir,
On Thu, 28 May 2026 17:19:37 +0200, Amir Goldstein wrote:
> fanotify13: fix test failure when running iterations
> The test case for FAN_SELETE_SELF deletes the objects created in
Typo: "FAN_SELETE_SELF" should be "FAN_DELETE_SELF".
> +#define TST_VARINAT_OVL_LOWER (tst_variant & 1)
Typo in macro name: "VARINAT" should be "VARIANT" -> TST_VARIANT_OVL_LOWER.
It is used consistently with the typo throughout, but it should be fixed.
> + if (TST_VARINAT_OVL_LOWER) {
> + rename_exchange_unsupported = renameat2(AT_FDCWD, FILE_PATH_ONE,
> + AT_FDCWD, FILE_PATH_TWO,
> + RENAME_EXCHANGE);
> + if (rename_exchange_unsupported) {
> + tst_res(TCONF, "RENAME_EXCHANGE not supported on %s",
> + tst_device->fs_type);
> + }
> + }
The return value of renameat2(2) is -1 on any error, not only when
RENAME_EXCHANGE is unsupported. Storing the raw return value means any
transient failure (EIO, ENOMEM, ...) silently sets rename_exchange_unsupported
and causes all FAN_DELETE_SELF variants to TCONF, masking a real problem.
Check errno for EOPNOTSUPP/EINVAL before setting the flag:
rename_exchange_unsupported = (renameat2(...) == -1 &&
(errno == EOPNOTSUPP || errno == EINVAL));
---
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