All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] f2fs/004: avoid race condition in test
@ 2025-05-30  9:23 ` Jan Prusakowski via Linux-f2fs-devel
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Prusakowski @ 2025-05-30  9:23 UTC (permalink / raw)
  To: Zorro Lang, fstests; +Cc: jaegeuk, linux-f2fs-devel, Jan Prusakowski

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


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

* [f2fs-dev] [PATCH v1] f2fs/004: avoid race condition in test
@ 2025-05-30  9:23 ` Jan Prusakowski via Linux-f2fs-devel
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Prusakowski via Linux-f2fs-devel @ 2025-05-30  9:23 UTC (permalink / raw)
  To: Zorro Lang, fstests; +Cc: jaegeuk, Jan Prusakowski, linux-f2fs-devel

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



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

* Re: [f2fs-dev] [PATCH v1] f2fs/004: avoid race condition in test
  2025-05-30  9:23 ` [f2fs-dev] " Jan Prusakowski via Linux-f2fs-devel
@ 2025-05-30 12:53   ` Chao Yu via Linux-f2fs-devel
  -1 siblings, 0 replies; 4+ messages in thread
From: Chao Yu @ 2025-05-30 12:53 UTC (permalink / raw)
  To: Jan Prusakowski, Zorro Lang, fstests; +Cc: chao, jaegeuk, linux-f2fs-devel

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.
> 
> Signed-off-by: Jan Prusakowski <jprusakowski@google.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

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

* Re: [f2fs-dev] [PATCH v1] f2fs/004: avoid race condition in test
@ 2025-05-30 12:53   ` Chao Yu via Linux-f2fs-devel
  0 siblings, 0 replies; 4+ messages in thread
From: Chao Yu via Linux-f2fs-devel @ 2025-05-30 12:53 UTC (permalink / raw)
  To: Jan Prusakowski, Zorro Lang, fstests; +Cc: jaegeuk, linux-f2fs-devel

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.
> 
> Signed-off-by: Jan Prusakowski <jprusakowski@google.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

end of thread, other threads:[~2025-05-30 12:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-30  9:23 [PATCH v1] f2fs/004: avoid race condition in test Jan Prusakowski
2025-05-30  9:23 ` [f2fs-dev] " Jan Prusakowski via Linux-f2fs-devel
2025-05-30 12:53 ` Chao Yu
2025-05-30 12:53   ` Chao Yu via Linux-f2fs-devel

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.