Create a stress test for the free inode btree. Allocate a set of inodes
sequentually and run a hard link clone and random replacement algorithm
across the set. Background removal of the oldest directories creates a
sparse set of free inodes over time. Run an fsstress workload
concurrently to exercise the fs.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
The finobt creates a duplicate subset of inode allocation metadata from
the inobt. xfs_repair should detect and repair inconsistencies in the
finobt that could be caused by bugs or corruption. This test uses xfs_db
to cause targeted corruptions in the finobt and verify repair detects
and corrects the filesystem.
In particular, the test corrupts individual finobt records to cause
inconsistency between the inode allocation count fields as well as
causing the finobt to contain a record with no free inodes.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
There is no mainline kernel support for DMAPI in XFS, and so every
time the xfstests auto group is run it throws a large number of
"[not run] Assuming DMAPI modules are not loaded". I've noted that
people are excluding the dmapi group to avoid this, so rather than
inflict pain on everyone, make hose few that need to do dmapi
testing include it specifically.
IOWs, remove the DMAPI tests from the auto group.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
The Q_XQUOTARM quotactl was not working properly, because
we weren't passing in proper flags. The xfs_fs_set_xstate()
ioctl handler used the same flags for Q_XQUOTAON/OFF as
well as Q_XQUOTARM, but Q_XQUOTAON/OFF look for
XFS_UQUOTA_ACCT, XFS_UQUOTA_ENFD, XFS_GQUOTA_ACCT etc,
i.e. quota type + state, while Q_XQUOTARM looks only for
the type of quota, i.e. XFS_DQ_USER, XFS_DQ_GROUP etc.
Unfortunately these flag spaces overlap a bit, so we
got semi-random results for Q_XQUOTARM; i.e. the value
for XFS_DQ_USER == XFS_UQUOTA_ACCT, etc. yeargh.
Anyway, here's a simple test that demonstrates it,
kernel patch to fix it will follow.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
the commit:
10e6e65 xfs: be more forgiving of a v4 secondary sb w/ junk in v5 fields
broke primary sb CRC validation, not erroring out the mount
if the crc was bad.
This tests that it's fixed, and properly fails the mount on
a bad crc.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Test that we properly ignore old growfs-induced junk in the unused
portion of secondary V4 superblocks; at one point this would
trip up the verifiers, and cause a subsequent growfs to fail.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Test the setting of the XFS BMBT fields via xfs_db. Runs through the
valid bit values for each field and tests an illegal value.
[dchinner: added _require_xfs_mkfs_crc and turned off crcs so that
the test doesn't just fail on CRC enabled test runs.]
[dchinner: added hex block values to check they don't get endian
swapped.]
Signed-off-by: Mark Tinguely <tinguely@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This has found several issues with recovery on CRC based
filesystems. It is based on a test case for a dir3 assert failure
provided by Michael L Semon.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Introduce xfs/305 to verify that we can turn group/project quotas
off while user quotas is on and fsstress is running at the same time.
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Introduce xfs/304 to verify that we can turn group/project quotas
off while user quotas is on.
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Introduce a new test to verify xfs_quota administrator commands can
deal with invalid XFS mount path properly without NULL pointer
dereference issue.
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Multi-stream xfsdump/xfsrestore of more than partialmax wholly-sparse
files segfaults with the following warning:
"partial_reg: Out of records. Extend attrs applied early."
Add a test that dumps and restores partialmax + 1 wholly-sparse files.
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Verify extended attributes are not lost after multi-stream
xfsdump/xfsrestore of wholly-sparse files. The restore succeeds,
however the extended attributes for that file are lost.
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
In some cases selinux's creation of an xattr on the temporary
fd creates a local xattr, but the file we are trying to
defragment has attrs in extent format, and the forkoff mismatch
will cause xfs_fsr to fail. This test demonstrates it; I
have old patches sent to the list long ago that should fix
it. I'll resend them soon.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Add a test for testing all 3 (user, group and project) quotas together.
This is a modified version of xfstest 050.
Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Tests the XFS symlinks that are small enough to be in the
inode, but were move to a remote symlink due to an extended
attribute were correctly removed.
Signed-off-by: Mark Tinguely <tinguely@sgi.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
These are tests that are shared between multiple filesystems (moved
to shared), and udf/btrfs/ext4 specific tests, moved to appropriate
directories.
I created the "shared" directory to indicate tests that are not
truly generic, but also not filesystem specific. They might rely on
a feature that is only implmented in a few filesystems and so can't
be truly generic.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
[rjohnston@sgi.com reworked for TOT changes]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>