diff mbox series

[09/15] common: pass the realtime device to xfs_db when possible

Message ID 173992589345.4079457.12014427831544220477.stgit@frogsfrogsfrogs (mailing list archive)
State New
Headers show
Series [01/15] common/populate: refactor caching of metadumps to a helper | expand

Commit Message

Darrick J. Wong Feb. 19, 2025, 12:59 a.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Teach xfstests to pass the realtime device to xfs_db when it supports
that option.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
 common/xfs |    4 ++++
 1 file changed, 4 insertions(+)

Comments

Christoph Hellwig Feb. 19, 2025, 7:15 a.m. UTC | #1
Looks good:

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

Patch

diff --git a/common/xfs b/common/xfs
index c8f2ea241a2a41..547e91167718e9 100644
--- a/common/xfs
+++ b/common/xfs
@@ -308,6 +308,10 @@  _scratch_xfs_db_options()
 	SCRATCH_OPTIONS=""
 	[ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
 		SCRATCH_OPTIONS="-l$SCRATCH_LOGDEV"
+	if [ "$USE_EXTERNAL" = yes ] && [ ! -z "$SCRATCH_RTDEV" ]; then
+		$XFS_DB_PROG --help 2>&1 | grep -q -- '-R rtdev' && \
+			SCRATCH_OPTIONS="$SCRATCH_OPTIONS -R$SCRATCH_RTDEV"
+	fi
 	echo $SCRATCH_OPTIONS $* $SCRATCH_DEV
 }