Files
apfstests/tests/xfs/492
T
Darrick J. Wong 7e98d41a6e fstests: move test group info to test files
Refactor every test in the entire test suite to use the new boilerplate
functions.  This also migrates all the test group information into the
test files.  This patch has been autogenerated via the command:

./tools/convert-group btrfs ceph cifs ext4 f2fs generic nfs ocfs2 overlay perf shared udf xfs

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-06-27 22:50:02 +08:00

46 lines
1.1 KiB
Bash
Executable File

#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2018 Oracle. All Rights Reserved.
#
# FS QA Test No. 492
#
# Test detection & fixing of bad summary inode counts at mount time.
#
. ./common/preamble
_begin_fstest auto quick fuzz
# Import common functions.
. ./common/filter
# real QA test starts here
# Modify as appropriate.
_supported_fs xfs
_require_scratch
echo "Format and mount"
_scratch_mkfs > $seqres.full 2>&1
# pre-lazysbcount filesystems blindly trust the primary sb fdblocks
_require_scratch_xfs_features LAZYSBCOUNT
_scratch_mount >> $seqres.full 2>&1
echo "test file" > $SCRATCH_MNT/testfile
echo "Fuzz ifree"
_scratch_unmount
icount=$(_scratch_xfs_get_metadata_field icount 'sb 0')
_scratch_xfs_set_metadata_field ifree $((icount * 2)) 'sb 0' > $seqres.full 2>&1
echo "Detection and Correction"
_scratch_mount >> $seqres.full 2>&1
avail=$(stat -c '%d' -f $SCRATCH_MNT)
total=$(stat -c '%c' -f $SCRATCH_MNT)
echo "avail: $avail" >> $seqres.full
echo "total: $total" >> $seqres.full
test "$avail" -gt "$total" && echo "free inodes bad: $avail > $total"
# success, all done
status=0
exit