[LTP] [PATCH v2 2/2] syscalls/inotify{07, 08}: Fix TBROK on older kernels

Martin Doucha mdoucha@suse.cz
Tue May 26 10:44:45 CEST 2026


Hi,
for both patches:

Reviewed-by: Martin Doucha <mdoucha@suse.cz>

On 5/26/26 10:34, Cyril Hrubis wrote:
> When kernel fails to generate events the read returns EAGAIN and since
> we switched to SAFE_READ() the tests now TBROK when kernel does not
> generate events. Fix this by passing the newly introduced
> SAFE_READ_ANY_EAGAIN flag to the SAFE_READ().
> 
> Fixes: deda021818a4 ('inotify: modernize with SAFE_ wrappers')
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> ---
>   testcases/kernel/syscalls/inotify/inotify07.c | 2 +-
>   testcases/kernel/syscalls/inotify/inotify08.c | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/inotify/inotify07.c b/testcases/kernel/syscalls/inotify/inotify07.c
> index b4000f353..9cadbf656 100644
> --- a/testcases/kernel/syscalls/inotify/inotify07.c
> +++ b/testcases/kernel/syscalls/inotify/inotify07.c
> @@ -88,7 +88,7 @@ void verify_inotify(void)
>   	strcpy(event_set[test_cnt].name, FILE_NAME);
>   	test_cnt++;
>   
> -	int len = SAFE_READ(0, fd_notify, event_buf, EVENT_BUF_LEN);
> +	int len = SAFE_READ(SAFE_READ_ANY_EAGAIN, fd_notify, event_buf, EVENT_BUF_LEN);
>   
>   	int i = 0, test_num = 0;
>   	while (i < len) {
> diff --git a/testcases/kernel/syscalls/inotify/inotify08.c b/testcases/kernel/syscalls/inotify/inotify08.c
> index e0837cac3..23d3c5a65 100644
> --- a/testcases/kernel/syscalls/inotify/inotify08.c
> +++ b/testcases/kernel/syscalls/inotify/inotify08.c
> @@ -86,7 +86,7 @@ void verify_inotify(void)
>   	SAFE_TOUCH(OVL_LOWER"/"FILE_NAME, 0644, NULL);
>   	SAFE_TOUCH(OVL_UPPER"/"FILE_NAME, 0644, NULL);
>   
> -	int len = SAFE_READ(0, fd_notify, event_buf, EVENT_BUF_LEN);
> +	int len = SAFE_READ(SAFE_READ_ANY_EAGAIN, fd_notify, event_buf, EVENT_BUF_LEN);
>   
>   	int i = 0, test_num = 0;
>   	while (i < len) {


-- 
Martin Doucha   mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic


More information about the ltp mailing list