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

Cyril Hrubis chrubis@suse.cz
Mon May 25 17:14:49 CEST 2026


When kernel fails to generate events the read returns EAGAIN and since
we switches 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) {
-- 
2.53.0



More information about the ltp mailing list