[LTP] [PATCH] inotify: cleanup - limit masks, use SAFE_ wrappers

Petr Vorel pvorel@suse.cz
Mon Feb 16 11:20:39 CET 2026


Hi Jinseok Kim,

> Replace IN_ALL_EVENTS with minimal relevant masks and manual read/write
> with SAFE_READ/SAFE_WRITE for better stability and consistency.

> inotify12.c intentionally unchanged: raw read() + manual EAGAIN handling
> is required to treat missing second event as IN_IGNORED (normal case).

...
> +++ b/testcases/kernel/syscalls/inotify/inotify07.c
> @@ -88,12 +88,7 @@ void verify_inotify(void)
>  	strcpy(event_set[test_cnt].name, FILE_NAME);
>  	test_cnt++;

> -	int len = read(fd_notify, event_buf, EVENT_BUF_LEN);
> -	if (len == -1 && errno != EAGAIN) {
> -		tst_brk(TBROK | TERRNO,
> -			"read(%d, buf, %zu) failed",
> -			fd_notify, EVENT_BUF_LEN);
> -	}
> +	int len = SAFE_READ(0, fd_notify, event_buf, EVENT_BUF_LEN);

I suppose this should be also kept unchanged (similar to inotify12.c).
Or any reason why to skip?

Kind regards,
Petr


More information about the ltp mailing list