[LTP] inotify13: check rename cookie pairing after adjacent moves

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Thu Oct 29 20:56:52 CET 2026


Hi Hungyu,

On Wed Oct 28 05:15:18 2026 +0000, Hungyu Lin <dennylin0707@gmail.com> wrote:
> inotify13: check rename cookie pairing after adjacent moves

> +	len = SAFE_READ(SAFE_READ_ANY, fd_notify, buf.data, sizeof(buf.data));
> +	SAFE_CLOSE(fd_notify);
> +	fd_notify = -1;

SAFE_CLOSE() already sets fd_notify to -1, so the manual reset to -1 should
be removed.

> +static void cleanup(void)
> +{
> +	if (fd_notify >= 0)
> +		SAFE_CLOSE(fd_notify);
> +}

Use fd_notify != -1 instead of fd_notify >= 0 to check whether the file
descriptor is valid.

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