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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>