All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs/030: fix test for external log device
@ 2020-02-20  2:16 Eric Sandeen
  2020-02-20  2:20 ` Eric Sandeen
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Sandeen @ 2020-02-20  2:16 UTC (permalink / raw)
  To: fstests, linux-xfs; +Cc: Luis R. Rodriguez

Several tests fail if an external log device is used; in this case
the xfs_db invocation fails with a clear indication of why, so fix
that as other tests do by testing for and using the external log
option if present.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/common/repair b/common/repair
index 5a9097f4..cf69dde9 100644
--- a/common/repair
+++ b/common/repair
@@ -9,8 +9,12 @@ _zero_position()
 	value=$1
 	struct="$2"
 
+	SCRATCH_OPTIONS=""
+	[ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
+		SCRATCH_OPTIONS="-l$SCRATCH_LOGDEV"
+
 	# set values for off/len variables provided by db
-	eval `xfs_db -r -c "$struct" -c stack $SCRATCH_DEV | perl -ne '
+	eval `xfs_db -r -c "$struct" -c stack $SCRATCH_OPTIONS $SCRATCH_DEV | perl -ne '
 		if (/byte offset (\d+), length (\d+)/) {
 			print "offset=$1\nlength=$2\n"; exit
 		}'`
diff --git a/tests/xfs/030 b/tests/xfs/030
index efdb6a18..e1cc32ef 100755
--- a/tests/xfs/030
+++ b/tests/xfs/030
@@ -77,7 +77,10 @@ else
 	_scratch_unmount
 fi
 clear=""
-eval `xfs_db -r -c "sb 1" -c stack $SCRATCH_DEV | perl -ne '
+SCRATCH_OPTIONS=""
+[ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
+	SCRATCH_OPTIONS="-l$SCRATCH_LOGDEV"
+eval `xfs_db -r -c "sb 1" -c stack $SCRATCH_OPTIONS $SCRATCH_DEV | perl -ne '
 	if (/byte offset (\d+), length (\d+)/) {
 		print "clear=", $1 / 512, "\n"; exit
 	}'`



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

end of thread, other threads:[~2020-02-20 13:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-20  2:16 [PATCH] xfs/030: fix test for external log device Eric Sandeen
2020-02-20  2:20 ` Eric Sandeen
2020-02-20 13:42   ` Luis Chamberlain

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.