[LTP] [PATCH 3/3] inotify06: kernel version check

Dejan Jovicevic dejan.jovicevic@rt-rk.com
Wed Nov 2 12:57:04 CET 2016


For test inotify06, kernels prior to 4.2 have a race when inode
is being deleted while inotify group watching that inode is being
torn down. When the race is hit, the kernel crashes or loops. So,
added a check to see if the kernel is >= 4.2.0, and if not, the
test breaks with TCONF and an appropriate message.

Signed-off-by: Dejan Jovicevic <dejan.jovicevic@rt-rk.com>
---
 testcases/kernel/syscalls/inotify/inotify06.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/testcases/kernel/syscalls/inotify/inotify06.c b/testcases/kernel/syscalls/inotify/inotify06.c
index 71f7596..1caa70d 100644
--- a/testcases/kernel/syscalls/inotify/inotify06.c
+++ b/testcases/kernel/syscalls/inotify/inotify06.c
@@ -67,6 +67,9 @@ static void cleanup(void)
 
 static void setup(void)
 {
+    if (tst_kvercmp(4, 2, 0) < 0)
+		tst_brkm(TCONF, NULL, "Test must be run with kernel 4.2 or newer");
+
 	int i;
 
 	tst_sig(FORK, DEF_HANDLER, cleanup);
-- 
1.9.1



More information about the ltp mailing list