FS/XFS testing framework
 help / color / mirror / Atom feed
From: Jan Prusakowski <jprusakowski@google.com>
To: Zorro Lang <zlang@kernel.org>, fstests@vger.kernel.org
Cc: jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net,
	 Jan Prusakowski <jprusakowski@google.com>
Subject: [PATCH v1] f2fs/004: avoid race condition in test
Date: Fri, 30 May 2025 09:23:49 +0000	[thread overview]
Message-ID: <20250530092349.3407742-1-jprusakowski@google.com> (raw)

In current implementation the atomic write may not start before
the direct write and the test fails.

The patch adds a delay after starting the atomic write process
so it has a chance to actually start wrtiting data and set the
internal state of the file correctly.

Signed-off-by: Jan Prusakowski <jprusakowski@google.com>
---
 tests/f2fs/004 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/f2fs/004 b/tests/f2fs/004
index e08cee11..ac824c43 100755
--- a/tests/f2fs/004
+++ b/tests/f2fs/004
@@ -40,6 +40,9 @@ touch $dbfile
 $F2FS_IO_PROG write 1 0 32 zero atomic_commit $dbfile 3000 >> $seqres.full &
 atomic_write_pid=$!
 
+# wait a bit to allow the atomic write to start
+sleep 2
+
 # simulate concurrent direct read/write IO
 $XFS_IO_PROG -d -c "pread 0 128k" $dbfile
 $XFS_IO_PROG -d -c "pwrite 0 128k" $dbfile
-- 
2.49.0.1204.g71687c7c1d-goog


             reply	other threads:[~2025-05-30  9:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-30  9:23 Jan Prusakowski [this message]
2025-05-30 12:53 ` [f2fs-dev] [PATCH v1] f2fs/004: avoid race condition in test Chao Yu

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=20250530092349.3407742-1-jprusakowski@google.com \
    --to=jprusakowski@google.com \
    --cc=fstests@vger.kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=zlang@kernel.org \
    /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