Commit Graph

82 Commits

Author SHA1 Message Date
Darrick J. Wong 73f8e854f6 xfs: test attr_list_by_handle cursor iteration
Apparently the XFS attr_list_by_handle ioctl has never actually
copied the cursor contents back to user space, which means that
iteration has never worked.  Add a test case for this and see

"xfs: in _attrlist_by_handle, copy the cursor back to userspace".

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-08-05 10:44:50 +08:00
Darrick J. Wong f9261d3646 xfs/128: cycle_mount the scratch device
This test uses the scratch device, so cycle that, not the test dev.
This is also a xfs_fsr test, so put it in the fsr group.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-08-05 10:32:10 +08:00
Darrick J. Wong 7c61e4c39e xfs/26[34]: remove duplicate tests
These two tests were accidentally double-added as xfs/30[78], but
the newer versions have fixed up helper usage and fewer whitespace
problems, so nuke the old tests.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-08-05 10:32:10 +08:00
Zorro Lang b18191a1d0 xfs/106: rewrite to make it a reliable regression test
xfs/106 is testing basic functions of xfs_quota command, but
there're three problems prevent people from running it as a reliable
regression test (i.e. it's not in 'auto' group):

- It tests unavailable commands in current xfs_quota, e.g. "warn"
- Lack of test coverage of important commands, e.g. "disable,
  enable, off and remove" commands
- Test output doesn't match golden image

So rewrite this case to test as many xfs_quota sub-commands and
options as possible and add it to 'auto' group, except:

- some "-v" options
- all "-a" options, because it's hard to get deterministic output
- default quota, this should be already covered by other tests
- project command options, I will write another case to test it
- report command -l option, which is a new option and will cause
  failure when testing with xfsprogs prior to 3.1 version.
- quot command -c option, which may output different histogram in
  different systems or hosts.
- warn command, which is not currently implemented.
- print, df, free, help, quit and path commands.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-07-31 10:36:53 +08:00
Jan Tulak 9a8bdd886a xfs: Add mkfs input validation tests
mkfs.xfs does not do a very good job of input validation. This test
is designed to exercise the input validation and test good/bad
combinations of options being set. It will not pass on an old
mkfs.xfs binary - it is designed to be the test case for an input
validation cleanup (merged in spring/summer 2016).

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Jan Tulak <jtulak@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-07-18 16:55:04 +08:00
Eryu Guan a4cafa0937 xfs: fix wrong seq order in group file
006 and 007 are in reverse order, and this breaks tools to find the
next available seq number in group file (e.g. tools/nextid).

Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-07-18 11:21:57 +08:00
Darrick J. Wong 1103003600 xfs: test clearing reflink inode flag
Check that xfs_repair can clear the reflink inode flag.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-07-07 12:24:13 +08:00
Darrick J. Wong 872ccc54ca xfs: inject errors at various parts of the deferred op completion
Use the error injection mechanism to test log recovery of deferred
work.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-07-07 12:24:13 +08:00
Zorro Lang 2a7b77abcd xfs: configurable behavior on errors at unmount time
XFS used to retry forever on non-critical errors, and unmount could
hang in such case. Commit e6b3bb78962e ("xfs: add "fail at unmount"
error handling configuration") introduced an error configuration
option in sysfs(fail_at_unmount) and made this behavior
configurable.

Now test this "fail_at_unmount" behavior to make sure XFS doesn't
retry forever on error at unmount time, if configured so. Also
introduced new helpers to require/set/get sysfs attributes.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-07-07 12:24:13 +08:00
Brian Foster 9490edd677 xfs: test for post umount readahead completion panic
XFS has a bug where directory readahead completions can occur after
unmount. This can lead to a crash or panic because metadata read
verification attempts to access core XFS data structures (e.g., the
log) after they have been freed and certain pointers have been
reset.

Add a test that triggers directory readahead, delays the readahead
I/O and immediately unmounts the filesystem. This test is part of
the dangerous group as it will cause kernels affected by the bug to
crash.

[eguan replaced touch with echo to speedup file creation]

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-07-01 23:12:49 +08:00
Darrick J. Wong ffad9122b6 xfs: map multiple bmbt records to a single rmapbt record
Make sure that we can handle multiple bmbt records mapping to a
single rmapbt record.  This can happen if you fallocate more than
2^21 contiguous blocks to a file.

(Also add some helpers that can create huge devices with some
dm-zero and dm-snapshot fakery.)

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-06-15 15:44:49 +08:00
Darrick J. Wong 0199ca71d5 xfs: check accounting during refcountbt expansion
Ensure that refcountbt allocations during truncate operations come
from the per-AG reservation and are not charged to the transaction.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-06-15 15:44:49 +08:00
Darrick J. Wong b1e1b5fc8e xfs: recover copy-on-write leftover
Test recovery of CoW leftovers in xfs_repair.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-06-15 15:44:49 +08:00
Brian Foster c8c0cfc1ce xfs: discontiguous multi-block buffer logging test
XFS had a bug in the multi-block buffer logging code that caused a
NULL lv panic at log push time due to invalid regions being set in
the buffer log format bitmap. This was demonstrated by modifying a
multi-block directory buffer in a manner that only logs regions
beyond the first FSB-sized mapping of the buffer.

To recreate these conditions, this test fragments free space and
populates several directories with enough entries to require
discontiguous multi-block buffers. To recreate the problem, we
remove entries from the tail end of the directory and fsync to flush
the log.

Note that this test causes a panic on kernels affected by the bug.
As such, it is included in the 'dangerous' group. The bug is
resolved by kernel commit a3916e528b91 ("xfs: fix broken multi-fsb
buffer logging").

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
2016-06-15 15:34:52 +08:00
Andreas Gruenbacher 2c1896a44c xfs/191: Remove obsolete nfs4acl tests
The nfs4acl tests don't make sense anymore as they have been obsoleted
by richacls.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2016-03-23 17:39:11 +11:00
Eryu Guan 848f580287 fstests: make xfs/006 generic
xfs/006 has no requirements that are specific to XFS, so make it generic
and other filesystems could get some coverage too.

Along with the movement, I also added a test that removes all created
dirs, as that's how the original bug was found.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2016-03-23 17:39:11 +11:00
Darrick J. Wong 6243fb41f1 xfs: test per-ag allocation accounting during truncate-caused refcountbt expansion
Ensure that refcountbt allocations during truncate operations come
from the per-AG reservation and are not charged to the transaction.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2016-03-23 17:39:09 +11:00
Darrick J. Wong 64f56fd899 xfs: test copy-on-write leftover recovery
Test recovery of CoW leftovers in xfs_repair.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2016-03-23 17:37:29 +11:00
Zorro Lang 08aac973d5 xfs: new test default user/group quota
When default quota is set, all different quota types inherits the
same default value, include group quota. So if a user quota limit
larger than the default user quota value, it will still be limited
by the group default quota value.

An upstream patch for this bug:

  xfs: Split default quota limits by quota type

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
2016-02-19 10:49:54 +11:00
Darrick J. Wong c6f5bb394a reflink: kick the slow tests out of the 'quick' group
Since 'quick' tests are supposed to run in < 15s, kick out the ones
that can't finish that soon even on fast storage.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
2016-02-12 09:39:05 -08:00
Darrick J. Wong 5a1e1eda02 xfs: test source CoW across mixed block types with cowextsz set
Ensure that we can CoW the source file when the source file consists
of a range of mixed block types and there's a cowextsize hint set.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
2016-02-12 09:39:05 -08:00
Darrick J. Wong 4562a0f6d4 xfs: ensure that we don't crash when freeing the ag reservations on a ro mount
Christoph Hellwig discovered that the kernel crashed trying to free
the refcount btree per-ag reservation on a ro mount (because we don't
create the reservation except for rw mounts and ro->rw remounts).  So,
test this to make sure we never do that again. :)

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
2016-02-12 09:39:05 -08:00
Darrick J. Wong c74b4cb7b0 xfs: test xfs_getbmapx behavior with shared extents
Make sure that xfs_getbmapx behaves properly w.r.t. shared extents
and CoW fork reporting.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
2016-02-12 09:39:05 -08:00
Darrick J. Wong 0ace8feb84 xfs: aio cow tests
Test what happens when AIO writes fail when we have a cowextsize hint
set on the files.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
2016-02-12 09:39:05 -08:00
Darrick J. Wong 34f8839435 xfs: test rmapbt functionality
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
2016-02-12 09:39:05 -08:00