linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] fstests: various fixes
@ 2019-08-15 15:18 Darrick J. Wong
  2019-08-15 15:18 ` [PATCH 1/3] generic/081: fix lvm config not being cleaned up properly Darrick J. Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Darrick J. Wong @ 2019-08-15 15:18 UTC (permalink / raw)
  To: guaneryu, darrick.wong; +Cc: linux-xfs, fstests

Hi all,

Fix broken cleanup in some tests.

Fix the mixed buffered/directio filtering function to pick up the new
locations of the iomap directio code, fix generic/081's broken lvm
cleanup, and reduce the time generic/561 waits for duperemove to finish.

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D

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

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

* [PATCH 1/3] generic/081: fix lvm config not being cleaned up properly
  2019-08-15 15:18 [PATCH 0/3] fstests: various fixes Darrick J. Wong
@ 2019-08-15 15:18 ` Darrick J. Wong
  2019-08-15 15:19 ` [PATCH 2/3] generic/561: kill duperemove directly Darrick J. Wong
  2019-08-15 15:19 ` [PATCH 3/3] common: filter aiodio dmesg after fs/iomap.c to fs/iomap/ move Darrick J. Wong
  2 siblings, 0 replies; 4+ messages in thread
From: Darrick J. Wong @ 2019-08-15 15:18 UTC (permalink / raw)
  To: guaneryu, darrick.wong; +Cc: linux-xfs, fstests

From: Darrick J. Wong <darrick.wong@oracle.com>

Fix a race between _cleanup and dmeventd that causes the lvm
configuration not to be cleaned up and subsequent tests to fail.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/generic/081 |   29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)


diff --git a/tests/generic/081 b/tests/generic/081
index 10f4a186..e8f4f5b5 100755
--- a/tests/generic/081
+++ b/tests/generic/081
@@ -19,12 +19,29 @@ _cleanup()
 {
 	cd /
 	rm -f $tmp.*
-	# lvm may have umounted it on I/O error, but in case it does not
-	# wait a bit for lvm to settle, sigh..
-	sleep 2
-	$UMOUNT_PROG $mnt >/dev/null 2>&1
-	$LVM_PROG vgremove -f $vgname >>$seqres.full 2>&1
-	$LVM_PROG pvremove -f $SCRATCH_DEV >>$seqres.full 2>&1
+
+	# Tear down the lvm vg and snapshot.
+	#
+	# NOTE: We do the unmount and {vg,pv}remove in a loop here because
+	# dmeventd could be configured to unmount the filesystem automatically
+	# after the IO errors.  That is racy with the umount we're trying to do
+	# here because there's a window in which the directory tree has been
+	# removed from the mount namespaces (so the umount call here sees no
+	# mount and exits) but the filesystem hasn't yet released the block
+	# device, which causes the vgremove here to fail.
+	#
+	# We "solve" the race by repeating the umount/lvm teardown until the
+	# block device goes away, because we cannot exit this test without
+	# removing the lvm devices from the scratch device -- this will cause
+	# other tests to fail.
+	while test -e /dev/mapper/$vgname-$snapname || \
+	      test -e /dev/mapper/$vgname-$lvname; do
+		$UMOUNT_PROG $mnt >> $seqres.full 2>&1
+		$LVM_PROG vgremove -f $vgname >>$seqres.full 2>&1
+		$LVM_PROG pvremove -f $SCRATCH_DEV >>$seqres.full 2>&1
+		test $? -eq 0 && break
+		sleep 2
+	done
 }
 
 # get standard environment, filters and checks

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

* [PATCH 2/3] generic/561: kill duperemove directly
  2019-08-15 15:18 [PATCH 0/3] fstests: various fixes Darrick J. Wong
  2019-08-15 15:18 ` [PATCH 1/3] generic/081: fix lvm config not being cleaned up properly Darrick J. Wong
@ 2019-08-15 15:19 ` Darrick J. Wong
  2019-08-15 15:19 ` [PATCH 3/3] common: filter aiodio dmesg after fs/iomap.c to fs/iomap/ move Darrick J. Wong
  2 siblings, 0 replies; 4+ messages in thread
From: Darrick J. Wong @ 2019-08-15 15:19 UTC (permalink / raw)
  To: guaneryu, darrick.wong; +Cc: linux-xfs, fstests

From: Darrick J. Wong <darrick.wong@oracle.com>

While the kill statement added in the previous patch usually suffices to
shut down the bash loop that runs the duperemove processes, for whatever
reason this sometimes fails to kill duperemove.  Kill the duperemove
processes directly after removing the run file, which should cause the
bash loop to exit immediately.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/generic/561 |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


diff --git a/tests/generic/561 b/tests/generic/561
index 2f3eff3c..26ecff5d 100755
--- a/tests/generic/561
+++ b/tests/generic/561
@@ -47,7 +47,7 @@ function end_test()
 	# stop duperemove running
 	if [ -e $dupe_run ]; then
 		rm -f $dupe_run
-		kill -INT $dedup_pids
+		$KILLALL_PROG -q $DUPEREMOVE_PROG > /dev/null 2>&1
 		wait $dedup_pids
 	fi
 
@@ -74,7 +74,7 @@ for ((i = 0; i < $((2 * LOAD_FACTOR)); i++)); do
 	while [ -e $dupe_run ]; do
 		$DUPEREMOVE_PROG -dr --dedupe-options=same $testdir \
 			>>$seqres.full 2>&1
-	done &
+	done 2>&1 | sed -e '/Terminated/d' &
 	dedup_pids="$! $dedup_pids"
 done
 

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

* [PATCH 3/3] common: filter aiodio dmesg after fs/iomap.c to fs/iomap/ move
  2019-08-15 15:18 [PATCH 0/3] fstests: various fixes Darrick J. Wong
  2019-08-15 15:18 ` [PATCH 1/3] generic/081: fix lvm config not being cleaned up properly Darrick J. Wong
  2019-08-15 15:19 ` [PATCH 2/3] generic/561: kill duperemove directly Darrick J. Wong
@ 2019-08-15 15:19 ` Darrick J. Wong
  2 siblings, 0 replies; 4+ messages in thread
From: Darrick J. Wong @ 2019-08-15 15:19 UTC (permalink / raw)
  To: guaneryu, darrick.wong; +Cc: linux-xfs, fstests

From: Darrick J. Wong <darrick.wong@oracle.com>

Since the iomap code are moving to fs/iomap/ we have to add new entries
to the aiodio dmesg filter to reflect this.  It's still possible for
filesystems using iomap for directio to cough up WARNings when a direct
write collides with a buffered write, since in some cases we catch that
early enough to have the direct write return EIO.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 common/filter |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)


diff --git a/common/filter b/common/filter
index ed082d24..26fc2132 100644
--- a/common/filter
+++ b/common/filter
@@ -555,6 +555,7 @@ _filter_aiodio_dmesg()
 	local warn7="WARNING:.*fs/iomap\.c:.*iomap_dio_actor.*"
 	local warn8="WARNING:.*fs/iomap\.c:.*iomap_dio_complete.*"
 	local warn9="WARNING:.*fs/direct-io\.c:.*dio_complete.*"
+	local warn10="WARNING:.*fs/iomap/direct-io\.c:.*iomap_dio_actor.*"
 	sed -e "s#$warn1#Intentional warnings in xfs_file_dio_aio_write#" \
 	    -e "s#$warn2#Intentional warnings in xfs_file_dio_aio_read#" \
 	    -e "s#$warn3#Intentional warnings in xfs_file_read_iter#" \
@@ -563,7 +564,8 @@ _filter_aiodio_dmesg()
 	    -e "s#$warn6#Intentional warnings in __xfs_get_blocks#" \
 	    -e "s#$warn7#Intentional warnings in iomap_dio_actor#" \
 	    -e "s#$warn8#Intentional warnings in iomap_dio_complete#" \
-	    -e "s#$warn9#Intentional warnings in dio_complete#"
+	    -e "s#$warn9#Intentional warnings in dio_complete#" \
+	    -e "s#$warn10#Intentional warnings in iomap_dio_actor#"
 }
 
 # We generate assert related WARNINGs on purpose and make sure test doesn't fail

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

end of thread, other threads:[~2019-08-15 15:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-15 15:18 [PATCH 0/3] fstests: various fixes Darrick J. Wong
2019-08-15 15:18 ` [PATCH 1/3] generic/081: fix lvm config not being cleaned up properly Darrick J. Wong
2019-08-15 15:19 ` [PATCH 2/3] generic/561: kill duperemove directly Darrick J. Wong
2019-08-15 15:19 ` [PATCH 3/3] common: filter aiodio dmesg after fs/iomap.c to fs/iomap/ move Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).