public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET 0/3] fstests: random fixes for v2023.12.10
@ 2023-12-13 22:34 Darrick J. Wong
  2023-12-13 22:34 ` [PATCH 1/3] generic/615: fix loop termination failures Darrick J. Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Darrick J. Wong @ 2023-12-13 22:34 UTC (permalink / raw)
  To: djwong, zlang; +Cc: guan, fstests, linux-xfs

Hi all,

Here's the usual odd fixes for fstests.

If you're going to start using this code, I strongly recommend pulling
from my git trees, which are linked below.

This has been running on the djcloud for months with no problems.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=random-fixes

xfsprogs git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=random-fixes

fstests git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=random-fixes
---
 tests/generic/410 |    2 +-
 tests/generic/615 |    6 ++++--
 tests/generic/735 |    1 +
 3 files changed, 6 insertions(+), 3 deletions(-)


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

* [PATCH 1/3] generic/615: fix loop termination failures
  2023-12-13 22:34 [PATCHSET 0/3] fstests: random fixes for v2023.12.10 Darrick J. Wong
@ 2023-12-13 22:34 ` Darrick J. Wong
  2023-12-14  4:44   ` Christoph Hellwig
  2023-12-13 22:34 ` [PATCH 2/3] generic/410: don't blow away seqres.full during test Darrick J. Wong
  2023-12-13 22:34 ` [PATCH 3/3] generic/735: skip this test if we cannot finsert at pos 1M Darrick J. Wong
  2 siblings, 1 reply; 7+ messages in thread
From: Darrick J. Wong @ 2023-12-13 22:34 UTC (permalink / raw)
  To: djwong, zlang; +Cc: guan, fstests, linux-xfs

From: Darrick J. Wong <djwong@kernel.org>

On 6.7-rc2, I've noticed that this test hangs unpredictably because the
stat loop fails to exit.  While the kill $loop_pid command /should/ take
care of it, it clearly isn't.

Set up an additional safety factor by checking for the existence of a
sentinel flag before starting the loop body.  In bash, "[" is a builtin
so the loop should run almost as tightly as it did before.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/generic/615 |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)


diff --git a/tests/generic/615 b/tests/generic/615
index 4979306d56..9411229874 100755
--- a/tests/generic/615
+++ b/tests/generic/615
@@ -21,11 +21,10 @@ _require_odirect
 
 stat_loop()
 {
-	trap "wait; exit" SIGTERM
 	local filepath=$1
 	local blocks
 
-	while :; do
+	while [ -e "$loop_file" ]; do
 		blocks=$(stat -c %b $filepath)
 		if [ $blocks -eq 0 ]; then
 		    echo "error: stat(2) reported zero blocks"
@@ -39,6 +38,8 @@ _scratch_mount
 
 $XFS_IO_PROG -f -s -c "pwrite -b 64K 0 64K" $SCRATCH_MNT/foo > /dev/null
 
+loop_file=$tmp.loopfile
+touch $loop_file
 stat_loop $SCRATCH_MNT/foo &
 loop_pid=$!
 
@@ -64,6 +65,7 @@ for ((i = 0; i < 2000; i++)); do
 	$XFS_IO_PROG -d -c "pwrite -b 64K 0 64K" $SCRATCH_MNT/foo > /dev/null
 done
 
+rm -f $loop_file
 kill $loop_pid &> /dev/null
 wait
 


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

* [PATCH 2/3] generic/410: don't blow away seqres.full during test
  2023-12-13 22:34 [PATCHSET 0/3] fstests: random fixes for v2023.12.10 Darrick J. Wong
  2023-12-13 22:34 ` [PATCH 1/3] generic/615: fix loop termination failures Darrick J. Wong
@ 2023-12-13 22:34 ` Darrick J. Wong
  2023-12-14  4:44   ` Christoph Hellwig
  2023-12-13 22:34 ` [PATCH 3/3] generic/735: skip this test if we cannot finsert at pos 1M Darrick J. Wong
  2 siblings, 1 reply; 7+ messages in thread
From: Darrick J. Wong @ 2023-12-13 22:34 UTC (permalink / raw)
  To: djwong, zlang; +Cc: guan, fstests, linux-xfs

From: Darrick J. Wong <djwong@kernel.org>

Don't truncate $seqres.full every time we format a new filesystem; this
makes debugging of this weird failure:

--- /tmp/fstests/tests/generic/410.out	2023-07-11 12:18:21.642971022 -0700
+++ /var/tmp/fstests/generic/410.out.bad	2023-11-29 01:13:00.020000000 -0800
@@ -107,6 +107,9 @@ mpB/dir SCRATCH_DEV
 mpC SCRATCH_DEV
 mpC/dir SCRATCH_DEV
 ======
+mkdir: cannot create directory '/mnt/410/3871733_mpA': File exists
+mkdir: cannot create directory '/mnt/410/3871733_mpB': File exists
+mkdir: cannot create directory '/mnt/410/3871733_mpC': File exists
 make-shared a slave shared mount
 before make-shared run on slave shared
 ------

nearly impossible.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/generic/410 |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/tests/generic/410 b/tests/generic/410
index 8cc36d9f38..5fb5441a0c 100755
--- a/tests/generic/410
+++ b/tests/generic/410
@@ -93,7 +93,7 @@ start_test()
 {
 	local type=$1
 
-	_scratch_mkfs >$seqres.full 2>&1
+	_scratch_mkfs >>$seqres.full 2>&1
 	_get_mount -t $FSTYP $SCRATCH_DEV $MNTHEAD
 	$MOUNT_PROG --make-"${type}" $MNTHEAD
 	mkdir $mpA $mpB $mpC


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

* [PATCH 3/3] generic/735: skip this test if we cannot finsert at pos 1M
  2023-12-13 22:34 [PATCHSET 0/3] fstests: random fixes for v2023.12.10 Darrick J. Wong
  2023-12-13 22:34 ` [PATCH 1/3] generic/615: fix loop termination failures Darrick J. Wong
  2023-12-13 22:34 ` [PATCH 2/3] generic/410: don't blow away seqres.full during test Darrick J. Wong
@ 2023-12-13 22:34 ` Darrick J. Wong
  2023-12-14  4:45   ` Christoph Hellwig
  2 siblings, 1 reply; 7+ messages in thread
From: Darrick J. Wong @ 2023-12-13 22:34 UTC (permalink / raw)
  To: djwong, zlang; +Cc: guan, fstests, linux-xfs

From: Darrick J. Wong <djwong@kernel.org>

Add a _require_congruent_file_oplen to screen out filesystem
configurations that can't start a finsert operation at file pos 1M
because the fs block size isn't congruent with 1048576.  For example,
xfs realtime with 28k rt extents.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/generic/735 |    1 +
 1 file changed, 1 insertion(+)


diff --git a/tests/generic/735 b/tests/generic/735
index 44b454771d..75b23d5efc 100755
--- a/tests/generic/735
+++ b/tests/generic/735
@@ -25,6 +25,7 @@ dev_size=$((80 * 1024 * 1024))
 _scratch_mkfs_sized $dev_size >>$seqres.full 2>&1 || _fail "mkfs failed"
 
 _scratch_mount
+_require_congruent_file_oplen $SCRATCH_MNT 1048576	# finsert at 1M
 file_blksz="$(_get_file_block_size ${SCRATCH_MNT})"
 
 # Reserve 1M space


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

* Re: [PATCH 1/3] generic/615: fix loop termination failures
  2023-12-13 22:34 ` [PATCH 1/3] generic/615: fix loop termination failures Darrick J. Wong
@ 2023-12-14  4:44   ` Christoph Hellwig
  0 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2023-12-14  4:44 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: zlang, guan, fstests, linux-xfs

On Wed, Dec 13, 2023 at 02:34:33PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> On 6.7-rc2, I've noticed that this test hangs unpredictably because the
> stat loop fails to exit.  While the kill $loop_pid command /should/ take
> care of it, it clearly isn't.
> 
> Set up an additional safety factor by checking for the existence of a
> sentinel flag before starting the loop body.  In bash, "[" is a builtin
> so the loop should run almost as tightly as it did before.

Loks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCH 2/3] generic/410: don't blow away seqres.full during test
  2023-12-13 22:34 ` [PATCH 2/3] generic/410: don't blow away seqres.full during test Darrick J. Wong
@ 2023-12-14  4:44   ` Christoph Hellwig
  0 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2023-12-14  4:44 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: zlang, guan, fstests, linux-xfs

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCH 3/3] generic/735: skip this test if we cannot finsert at pos 1M
  2023-12-13 22:34 ` [PATCH 3/3] generic/735: skip this test if we cannot finsert at pos 1M Darrick J. Wong
@ 2023-12-14  4:45   ` Christoph Hellwig
  0 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2023-12-14  4:45 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: zlang, guan, fstests, linux-xfs

On Wed, Dec 13, 2023 at 02:34:45PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Add a _require_congruent_file_oplen to screen out filesystem
> configurations that can't start a finsert operation at file pos 1M
> because the fs block size isn't congruent with 1048576.  For example,
> xfs realtime with 28k rt extents.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

end of thread, other threads:[~2023-12-14  4:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-13 22:34 [PATCHSET 0/3] fstests: random fixes for v2023.12.10 Darrick J. Wong
2023-12-13 22:34 ` [PATCH 1/3] generic/615: fix loop termination failures Darrick J. Wong
2023-12-14  4:44   ` Christoph Hellwig
2023-12-13 22:34 ` [PATCH 2/3] generic/410: don't blow away seqres.full during test Darrick J. Wong
2023-12-14  4:44   ` Christoph Hellwig
2023-12-13 22:34 ` [PATCH 3/3] generic/735: skip this test if we cannot finsert at pos 1M Darrick J. Wong
2023-12-14  4:45   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox