2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved.
7 # Check that getfsmap reports internal log devices
10 _begin_fstest auto quick rmap fsmap
12 # Override the default cleanup function.
16 rm -rf "$tmp".* $TEST_DIR/fsmap $TEST_DIR/testout
19 # Import common functions.
22 # real QA test starts here
24 _require_xfs_scratch_rmapbt
25 _require_xfs_io_command "fsmap"
26 if [ "$USE_EXTERNAL" = "yes" ] && [ -n "$SCRATCH_LOGDEV" ]; then
27 _notrun "Cannot have external log device"
32 echo "Format and mount"
33 _scratch_mkfs > "$seqres.full" 2>&1
36 echo "Get fsmap" | tee -a $seqres.full
37 $XFS_IO_PROG -c 'fsmap -v' $SCRATCH_MNT >> $seqres.full
38 $XFS_IO_PROG -c 'fsmap -v' $SCRATCH_MNT | tr '[]()' ' ' > $TEST_DIR/fsmap
40 echo "Check device field of FS metadata and journalling log"
41 data_dev=$(grep 'static fs metadata' $TEST_DIR/fsmap | head -n 1 | awk '{print $2}')
42 journal_dev=$(grep 'journalling log' $TEST_DIR/fsmap | head -n 1 | awk '{print $2}')
43 test "${data_dev}" = "${journal_dev}" || echo "data ${data_dev} journal ${journal_dev}?"