From: Fabian Vogt <fvogt@suse.de>
To: LTP List <ltp@lists.linux.it>
Subject: [LTP] [PATCH] syscalls/fcntl15: Wait until child processes did its work
Date: Mon, 13 Dec 2021 11:12:34 +0100 [thread overview]
Message-ID: <4712735.uizZLiLCHF@linux-e202.suse.de> (raw)
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
next reply other threads:[~2021-12-13 10:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-13 10:12 Fabian Vogt [this message]
2021-12-13 11:01 ` [LTP] [PATCH] syscalls/fcntl15: Wait until child processes did its work Cyril Hrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4712735.uizZLiLCHF@linux-e202.suse.de \
--to=fvogt@suse.de \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox