Commit Graph

239 Commits

Author SHA1 Message Date
Eric Sandeen 8322038f2b xfstests: test dump/restore of file capabilities
xfsrestore isn't properly restoring file capabilities; it restores
them, but then chowns the file, which removes the caps:

Call Trace:
 [<ffffffffa028de68>] xfs_xattr_set+0x118/0x120 [xfs]
 [<ffffffff8119a8c0>] generic_removexattr+0x80/0x90
 [<ffffffff8120b408>] cap_inode_killpriv+0x28/0x30
 [<ffffffff8120c666>] security_inode_killpriv+0x16/0x20
 [<ffffffff81192edf>] notify_change+0x18f/0x330
 [<ffffffff81176b70>] chown_common+0x60/0xa0
 [<ffffffff81176c30>] sys_fchown+0x80/0xd0
 [<ffffffff81537c59>] system_call_fastpath+0x16/0x1b

This test demonstrates the problem.

Reported-by: fugazzi® <fugazzi99@gmail.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
2013-01-29 17:26:02 -06:00
Eric Sandeen ae2328e7c9 xfstests: test multiply-logged inodes & continued transactions
New test for 2 xfs_logprint error cases:

As xlog_print_trans_inode() stands today, it will error
out if more than one flag is set on f->ilf_fields:

	xlog_print_trans_inode: illegal inode type

but this is a perfectly valid case, to have i.e. a data and
an attr flag set.

and:

xlog_print_trans_inode() has a special case for 2
specific op_head->oh_len lengths.  If it matches
sizeof(xfs_inode_log_format_32_t) or
sizeof(xfs_inode_log_format_64_t), it assumes that
it's got an inode, and attempts to convert it and
print it accordingly.

However, if we arrive here via an op header which
is continued, then the length is simply a continuation
of the previous op, and it might *randomly* match the
size of one of the inode log formats, and thus get parsed
incorrectly.

Test both of these cases.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
2013-01-29 13:59:56 -06:00
Eric Sandeen 2f136d62bf xfstests: test EROFS vs. EEXIST when creating on an RO filesystem
TBH, I don't know if this is posix-specified, but I found out the
hard way that when trying to re-create existing files on a readonly 
filesystem, some apps expect/handle EEXIST, but fail on EROFS.

This will test mkdir, mknod, and symlinks for that behavior.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
2013-01-21 16:42:04 -06:00
Eric Sandeen 244295ab8a xfstests: ensure all xfs_io commands are documented in the manpage
Ensure that all commands listed in "xfs_io -c help" are
documented in the xfs_io(8) manpage.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Mark Tinguely <tinguely@sgi.com>
2013-01-17 10:13:58 -06:00
Eric Sandeen 8bf7774258 xfstests: Ensure cmdline geometry puts mkfs.xfs into multidisk mode
Ensure that when mkfs.xfs is invoked with commandline geometry, it
triggers multidisk mode and creates more AGs.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
2013-01-04 14:20:10 -06:00
Eric Sandeen 2a4ed91a01 xfstest 291: userspace vs. fragmented multiblock dir2
Current xfs_repair is unhappy with fragmented multiblock
v2 directories.  This test shows it ... patches to fix
it soon to follow.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Mark Tinguely <tinguely@sgi.com>
2012-11-20 08:53:57 -06:00
Andrew Dahl 828463f727 xfstests: xfs_tosspages() test addition
Tests the XFS_IOC_ZERO_RANGE ioctl by way of the "xfs_io zero" utility
to ensure it is tossing the expected ranges.

The ranges tested are [0,1] [0,4095] [0,4096] [0,4097] [4095,8191]
  [4095,8192] [4095,8193] [4096,8192] [1024,4096]

Signed-off-by: Andrew Dahl <adahl@sgi.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Mark Tinguely <tinguely@sgi.com>
2012-11-20 08:53:57 -06:00
Eric Sandeen 0b2ab695c1 xfstests: test ext4 statfs
Calculating free blocks in ext[234] is surprisingly hard, since
by default we report "bsd" style df which doesn't count filesystem
"overhead" blocks as used.

With a lot of code dedicated to sorting out what to report as
free, things tend to go wrong surprisingly often.

Here's a test to actually try to stop the next regression.  ;)

NB: For bsddf, the kernel currently does not count journal blocks
as overhead; it probably should.  But the test below looks to have
the result within 1% of perfection, so it still passes even if
the kernel doesn't count the journal against free blocks.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
2012-10-29 08:47:09 -05:00
Lukas Czerner 00d1bda60d xfstests: Test FITRIM where length is smaller than FSB
This tests corner case in FITRIM implementation where range size is
smaller than file system block or zero. In this case FITRIM should fail
with EINVAL.

The problem was spotted in xfs and ext4 where in case of length = 0 the
'end' variable underflowed. In case of length smaller than 1 FSB FITRIM
finished successfully, but we really should rather return EINVAL in both
cases.

(This patch has to be applied after 'Use upstream version of fstrim
instead of the local one')

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
2012-10-24 12:43:33 -05:00
Ben Myers 681a33182c Merge branch 'master' of git://git.kernel.org/pub/scm/fs/xfs/xfstests-dev
Conflicts:
	285
	285.out
	group

Moved '285: Test xfs projid32bit functionality a bit more extensively' to 287.
2012-09-13 15:01:58 -05:00
Eric Sandeen 053126503b 285: Test xfs projid32bit functionality a bit more extensively
The test covers several areas including enabling projid32bit
functionality dynamically by xfs_admin, dumping, restoring, quota
reporting and xfs_db projid values reporting.

This test case hits a bug with xfsdump/xfsrestore process on a
projid32bit enabled filesystem.

Eric Sandeen: change {16,32}less filenames to {16,32}bit, add quick group

Signed-off-by: Boris Ranto <ranto.boris@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
2012-09-12 13:53:27 -05:00
Jeff Liu 7d1479581c xfstests: introduce 286 for SEEK_DATA/SEEK_HOLE copy test
Introduce 286 for SEEK_DATA/SEEK_HOLE copy tests.

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
2012-05-11 12:33:22 -05:00
Jeff Liu 35d4853d87 xfstests: introduce 285 for SEEK_DATA/SEEK_HOLE sanity test
Introduce 285 for SEEK_DATA/SEEK_HOLE sanity tests.

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
2012-05-11 12:15:20 -05:00
Liu Bo e875c9d88f add btrfs online defragment test
Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2012-03-31 20:14:06 +00:00
Bill Kendall 98f4fae38b xfstests: add tests 281-283 for old xfsdump format
Add three tests for verifying compatibility with xfsdump format 2.

Test 281 generates a format 2 dump and restores it.

Test 282 does a restore of a level 0 dump in the old dump format
followed by a restore of a level 1 dump in the current dump format.

Test 283 does a restore of a level 0 dump in the current dump format
followed by a restore of a level 1 dump in the old dump format.

Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2012-03-31 20:14:06 +00:00
Peng Haitao 80f2aaf701 071: make this test work as expected on Linux
When offset + length is overflow of xfs_io builtin pread and pwrite in linux,
the error message should be "Invalid argument".

In 32_bit, offset + length should cause pread and pwrite to error, So the
out should be OK.

The patch fix as following:
  - "pwrite64: Invalid argument" will be replaced with "pwrite64: File too large"
  - "pread64: Invalid argument" will be replaced with "read 0/xxx bytes at offset <OFFSET>"
  - delete _filter_xfs_io
  - add auto group
  - add 071.out.32

Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2012-03-31 20:14:06 +00:00
Eric Sandeen 3f28d55c39 add freeze and dangerous groups
Add 2 new test groups:

freeze: tests which test filesystem freeze
dangerous: tests which may hang or oops

The 2nd may be useful for automated testing to do i.e.

./check -g auto -x dangerous
./check -g auto,dangerous

to try to get fuller coverage before running into tests
which may panic or hang the box and stop the test cycle.

I doubt I have all the potential dangerous tests, but
they can be added later when found.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2012-03-31 20:14:06 +00:00
Eric Sandeen f46664daed 280: test freeze deadlock w/ quotas
This tests the quota+freeze hang scenario described & fixed in
dcdbed85 quota: Fix deadlock with suspend and quotas

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Jan Kara <jack@suse.cz>
2012-03-08 17:33:16 -06:00
Eric Sandeen 74ed5e51da 279: test mkfs with various sector sizes & alignments
This test uses the scsi_debug module to test mkfs against
various physical & logical sector sizes, and with aligned
and unaligned devices.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
2012-03-08 17:29:40 -06:00
Eric Sandeen f73f284b23 278: Ensure lost+found is not created with wrong link count
xfs_repair was leaving lost+found directory with a wrong link count when a
cleaned inode was re-used to create lost+found. This test case confirm that,
after xfs_repair is executed, the lost+found inode is left in a consistent
state.

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com> 
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
2012-01-27 13:05:07 -06:00
Li Zefan 2fa8b274b5 277: new test to verify on disk ctime update for chattr
We had a bug in btrfs which can be triggered by this test.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2012-01-04 18:43:00 +00:00
Jan Schmidt bd8ee45cf7 xfstests: 276: new test to ensure btrfs backref integrity
This is a btrfs specific scratch test checking the backref walker. It
creates a file system with compressed and uncompressed data extents, picks
files randomly and uses filefrag to get their extents. It then asks the
btrfs utility (inspect-internal) to do the backref resolving from fs-logical
address (the one filefrag calls "physical") back to the inode number and
file-logical offset, verifying the result.

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-12-08 17:11:38 +00:00
WuBo e219e1cb59 275: add a write and reserve test
This test is for write-posix test. If writing a file when the disk is almost
full, the posix wants the call to write as much as possible but not none.

quote the POSIX:
If a write() requests that more bytes be written than there is room for
(for example, [XSI] [Option Start] the process' file size limit or
[Option End] the physical end of a medium), only as many bytes as there
is room for shall be written. For example, suppose there is space for 20
bytes more in a file before reaching a limit. A write of 512 bytes will
return 20. The next write of a non-zero number of bytes would give a
failure return (except as noted below).

Signed-off-by: Wu Bo <Wu.Bo@cn.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-10 13:43:48 +00:00
WuBo 7ab8e4e297 274: add a prealloc and reserve test
This test is for preallocation test. If the disk is full, just with a prealloc
file has some free space that prealloc early. We need to check whether the write
to the free space is success or not.

Signed-off-by: Wu Bo <Wu.Bo@cn.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-10 13:43:48 +00:00
WuBo 58d2329e14 273: add a copy and reserve test
This test is a stress test. It creates a set of threads for coping small files
into disk. I use a 2G disk for test, the ENOSPC arises usually but the disk is
not full under kenerl 3.0 with intel64.

Signed-off-by: Wu Bo <Wu.Bo@cn.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2011-11-10 13:43:48 +00:00