[LTP] [PATCH 1/6] syscalls/fcntl: New test for DN_RENAME (dnotify)

Amir Goldstein amir73il@gmail.com
Thu Apr 14 17:31:29 CEST 2022


On Thu, Apr 14, 2022 at 6:12 PM Petr Vorel <pvorel@suse.cz> wrote:
>
> Hi Amir,
>
> could you please fix fcntl39.c to be running for more iterations?
>
> ./fcntl39_64 -i2
> tst_kconfig.c:82: TINFO: Parsing kernel config '/proc/config.gz'
> tst_test.c:1459: TINFO: Timeout per run is 0h 05m 00s
> fcntl39.c:68: TINFO: Testing no DN_RENAME on rename from parent to subdir
> fcntl39.c:73: TPASS: No event on parent as expected
> fcntl39.c:77: TPASS: No event on subdir as expected
> fcntl39.c:79: TINFO: Testing DN_RENAME on rename of subdir itself
> fcntl39.c:82: TPASS: Got event on parent as expected
> fcntl39.c:88: TPASS: No event on subdir as expected
> fcntl39.c:62: TBROK: open(test_dir,0,20254540) failed: ENOENT (2)
>
> Kind regards,
> Petr

Sorry forgot to run it with -i

Here is the fix if you want to apply it yourself:

--- a/testcases/kernel/syscalls/fcntl/fcntl39.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl39.c
@@ -89,6 +89,12 @@ static void verify_dnotify(void)

        SAFE_CLOSE(parent_fd);
        SAFE_CLOSE(subdir_fd);
+
+       /* Cleanup before rerun */
+       SAFE_RENAME(TEST_DIR2 "/" TEST_FILE, TEST_FILE);
+       SAFE_RENAME(TEST_DIR2, TEST_DIR);
+       got_parent_event = 0;
+       got_subdir_event = 0;
 }

Thanks,
Amir.


More information about the ltp mailing list