Skip to contentSkip to conversation

f2fs/004: avoid race condition in test

PATCH In review Jan Prusakowski 2 participants 2 messages May 30, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 f2fs/004: avoid race condition in test

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.

---
 tests/f2fs/004 | 3 +++
 1 file changed, 3 insertions(+)
tests/f2fs/004 +3 -0
index e08cee11..ac824c43 100755
@@ -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
Signature · 1 line
2.49.0.1204.g71687c7c1d-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · On 2025/5/30 17:23, Jan Prusakowski via Linux-f2fs-devel wrote:

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.

Thanks,