[PATCH 05/13] xfs: fix various problems with fsmap detecting the data device

Darrick J. Wong
2025-02-19T01:04:58Z

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

Various tests of realtime rmap functionality assumed that the data
device could be picked out from the GETFSMAP output by looking for
static fs metadata. This is no longer true, since rtgroups filesystems
write a superblock header at the start of the rt device, so update these
tests.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
tests/xfs/272 | 2 +-
tests/xfs/276 | 2 +-
tests/xfs/277 | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/xfs/272 b/tests/xfs/272
index 3e3ceec512421d..1d0edf67600aa5 100755
--- a/tests/xfs/272
+++ b/tests/xfs/272
@@ -55,7 +55,7 @@ cat $TEST_DIR/bmap | while read ext offrange colon blockrange ag agrange total c
done

echo "Check device field of FS metadata and regular file"
-data_dev=$(grep 'static fs metadata' $TEST_DIR/fsmap | head -n 1 | awk '{print $2}')
+data_dev=$(grep 'inode btree' $TEST_DIR/fsmap | head -n 1 | awk '{print $2}')
rt_dev=$(grep "${ino}[[:space:]]*[0-9]*\.\.[0-9]*" $TEST_DIR/fsmap | head -n 1 | awk '{print $2}')
test "${data_dev}" = "${rt_dev}" || echo "data ${data_dev} realtime ${rt_dev}?"

diff --git a/tests/xfs/276 b/tests/xfs/276
index 69de69d86cda9c..b675e79b249a5b 100755
--- a/tests/xfs/276
+++ b/tests/xfs/276
@@ -59,7 +59,7 @@ cat $TEST_DIR/bmap | while read ext offrange colon blockrange ag agrange total c
done

echo "Check device field of FS metadata and realtime file"
-data_dev=$(grep 'static fs metadata' $TEST_DIR/fsmap | head -n 1 | awk '{print $2}')
+data_dev=$(grep 'inode btree' $TEST_DIR/fsmap | head -n 1 | awk '{print $2}')
rt_dev=$(grep "${ino}[[:space:]]*[0-9]*\.\.[0-9]*[[:space:]]*[0-9]*$" $TEST_DIR/fsmap | head -n 1 | awk '{print $2}')
test "${data_dev}" != "${rt_dev}" || echo "data ${data_dev} realtime ${rt_dev}?"

diff --git a/tests/xfs/277 b/tests/xfs/277
index 5cb44c33e81570..87423b96454fa4 100755
--- a/tests/xfs/277
+++ b/tests/xfs/277
@@ -36,7 +36,7 @@ $XFS_IO_PROG -c 'fsmap -v' $SCRATCH_MNT >> $seqres.full
$XFS_IO_PROG -c 'fsmap -v' $SCRATCH_MNT | tr '[]()' ' ' > $TEST_DIR/fsmap

echo "Check device field of FS metadata and journalling log"
-data_dev=$(grep 'static fs metadata' $TEST_DIR/fsmap | head -n 1 | awk '{print $2}')
+data_dev=$(grep 'inode btree' $TEST_DIR/fsmap | head -n 1 | awk '{print $2}')
journal_dev=$(grep 'journalling log' $TEST_DIR/fsmap | head -n 1 | awk '{print $2}')
test "${data_dev}" = "${journal_dev}" || echo "data ${data_dev} journal ${journal_dev}?"