From: Darrick J. Wong <djwong@xxxxxxxxxx> Teach xfstests to pass the realtime device to xfs_db when it supports that option. Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx> --- common/xfs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/common/xfs b/common/xfs index 175de69c63..aa1c23dd54 100644 --- a/common/xfs +++ b/common/xfs @@ -282,10 +282,10 @@ _xfs_check() { OPTS=" " DBOPTS=" " - USAGE="Usage: xfs_check [-fsvV] [-l logdev] [-i ino]... [-b bno]... special" + USAGE="Usage: xfs_check [-fsvV] [-l logdev] [-r rtdev] [-i ino]... [-b bno]... special" OPTIND=1 - while getopts "b:fi:l:stvV" c; do + while getopts "b:fi:l:stvVR:" c; do case $c in s) OPTS=$OPTS"-s ";; t) OPTS=$OPTS"-t ";; @@ -297,6 +297,7 @@ _xfs_check() V) $XFS_DB_PROG -p xfs_check -V return $? ;; + r) DBOPTS="$DBOPTS -R $OPTARG";; esac done set -- extra $@ @@ -340,6 +341,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 } @@ -404,6 +409,11 @@ _scratch_xfs_check() SCRATCH_OPTIONS="-l $SCRATCH_LOGDEV" [ "$LARGE_SCRATCH_DEV" = yes ] && \ SCRATCH_OPTIONS=$SCRATCH_OPTIONS" -t" + if [ "$USE_EXTERNAL" = yes ] && [ ! -z "$SCRATCH_RTDEV" ]; then + $XFS_DB_PROG --help 2>&1 | grep -q -- '-R rtdev' || \ + _notrun 'xfs_db does not support rt devices' + SCRATCH_OPTIONS="$SCRATCH_OPTIONS -R$SCRATCH_RTDEV" + fi _xfs_check $SCRATCH_OPTIONS $* $SCRATCH_DEV }