#! /bin/bash
# FS QA Test 424
#
-# xfs_db should take type size into account when setting type.
-# If type size isn't updated whenever type is set, a false crc
-# error can occur due to the stale size. This test checks for
-# that false crc error.
+# This case checks if setting type causes error.
#
+# On crc filesystems, xfs_db doesn't take sector size into account
+# when setting type, and this can result in an errant crc.
+# This issue has been fixed in xfsprogs-dev:
+# '55f224b ("xfs_db: update buffer size when new type is set")'
+#
+# On crc filesystems, when setting the type to "inode" the verifier
+# validates multiple inodes in the current fs block, so setting the
+# buffer size to that of just one inode is not sufficient and it'll
+# emit spurious verifier errors for all but the first.
+# This issue has been fixed in xfsprogs-dev:
+# '533d1d2 ("xfs_db: properly set inode type")'
#-----------------------------------------------------------------------
# Copyright (c) 2017 Red Hat, Inc. All Rights Reserved.
#
done
for SECTOR_SIZE in $sector_sizes; do
- $MKFS_XFS_PROG -f -s size=$SECTOR_SIZE $SCRATCH_DEV > /dev/null
+ finobt_enabled=0
+ $MKFS_XFS_PROG -f -s size=$SECTOR_SIZE $SCRATCH_DEV | \
+ grep -q 'finobt=1' && finobt_enabled=1
for TYPE in agf agi agfl sb; do
DADDR=`_scratch_xfs_db -c "$TYPE" -c "daddr" | filter_dbval`
DADDR=`_scratch_xfs_db -c "agi" -c "addr root" -c "daddr" |
filter_dbval`
_scratch_xfs_db -c "daddr $DADDR" -c "type inobt"
- DADDR=`_scratch_xfs_db -c "agi" -c "addr free_root" -c "daddr" |
- filter_dbval`
- _scratch_xfs_db -c "daddr $DADDR" -c "type finobt"
+ if [ $finobt_enabled -eq 1 ]; then
+ DADDR=`_scratch_xfs_db -c "agi" -c "addr free_root" -c "daddr" |
+ filter_dbval`
+ _scratch_xfs_db -c "daddr $DADDR" -c "type finobt"
+ fi
_scratch_xfs_db -c "daddr $DADDR" -c "type text"
_scratch_xfs_db -c "daddr $DADDR" -c "type data"