All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] syscalls/fcntl15: Wait until child processes did its work
@ 2021-12-13 10:12 Fabian Vogt
  2021-12-13 11:01 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Vogt @ 2021-12-13 10:12 UTC (permalink / raw)
  To: LTP List

The child process might not have completed locking region two when the parent
expectes it to. Wait for it.

Fixes: 079de87f9522 ("syscalls/fcntl15: Convert to new API")
Signed-off-by: Fabian Vogt <fvogt@suse.de>
---
 testcases/kernel/syscalls/fcntl/fcntl15.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/fcntl/fcntl15.c b/testcases/kernel/syscalls/fcntl/fcntl15.c
index 59328605ac2b..82dee4b21ee2 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl15.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl15.c
@@ -75,7 +75,7 @@ static void lock_region_two(int file_flag, int file_mode)
 
 	SAFE_FCNTL(fd, F_SETLK, &lock_two);
 
-	TST_CHECKPOINT_WAIT(1);
+	TST_CHECKPOINT_WAKE_AND_WAIT(1);
 
 	SAFE_CLOSE(fd);
 }
@@ -143,8 +143,11 @@ static int run_test(int file_flag, int file_mode, int dup_flag)
 
 	SAFE_FCNTL(fd[0], F_SETLK, &lock_one);
 
+	// Lock region two or wait until the child locked it
 	if (dup_flag != FORK_)
 		SAFE_FCNTL(fd[1], F_SETLK, &lock_two);
+	else
+		TST_CHECKPOINT_WAIT(1);
 
 	if (!SAFE_FORK()) {
 		do_test(file_flag, file_mode, dup_flag);
-- 
2.33.1





-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [LTP] [PATCH] syscalls/fcntl15: Wait until child processes did its work
  2021-12-13 10:12 [LTP] [PATCH] syscalls/fcntl15: Wait until child processes did its work Fabian Vogt
@ 2021-12-13 11:01 ` Cyril Hrubis
  0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2021-12-13 11:01 UTC (permalink / raw)
  To: Fabian Vogt; +Cc: LTP List

Hi!
Good catch. I've adjusted the commit message a bit and pushed, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-13 11:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-13 10:12 [LTP] [PATCH] syscalls/fcntl15: Wait until child processes did its work Fabian Vogt
2021-12-13 11:01 ` Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.