generic/085 was failing on a machine w/o devicemapper kernel
support because it requires the linear target, but didn't
explicitly test for it.
I could have cut & pasted _require_dm_linear(), but chose
to go the route of a generic helper, _require_dm_target $FOO,
because some day someone will need the zero target, the error
target, or who knows.
Add the helper, use it in test generic/085, and convert
_require_dm_flakey, _require_dm_snapshot, and
_dmerror_required with this new helper.
Reported-by: Angelo Dureghello <angelo.dureghello@nomovok.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Regression test for file read corruption when using compressed extents
that represent file ranges with a length that is a multiple of 16 pages
and that are shared by multiple consecutive ranges of the same file.
This is similar to the test added in commit 694db0c050 ("btrfs: read
corruption of compressed extents"), but tests the special case where the
extent's uncompressed length is a multiple of 16 pages. The first btrfs
fix, tested by the test added in the commit mentioned before, failed to
address this special case.
This btrfs issue is fixed by the linux kernel patch titled:
"Btrfs: update fix for read corruption of compressed and shared extents"
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Test that an incremental send works after a file from the parent snapshot
gets replaced in the send snapshot by another one at the same exact
location, with the same name and with the same inode number.
This test used to fail after the linux kernel commit 8b191a684968
("Btrfs: incremental send, check if orphanized dir inode needs delayed
rename") and it's fixed by patch titled:
"Btrfs: send, fix corner case for reference overwrite detection"
Signed-off-by: Martin Raiber <martin@urbackup.org>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Test btrfs quota group consistency operations during snapshot
delete. Btrfs has had long standing issues with drop snapshot
failing to properly account for quota groups. This test crafts
several snapshot trees with shared and exclusive elements. One of
the trees is removed and then quota group consistency is checked.
This issue is fixed by the following linux kernel patches:
Btrfs: use btrfs_get_fs_root in resolve_indirect_ref
Btrfs: keep dropped roots in cache until transaciton commit
btrfs: qgroup: account shared subtree during snapshot delete
Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
As a workaround for a regression in the uuid filter introduced by
a092363bbd ("xfs: test changing UUID on V5 superblock"), the btrfs
100 and 101 tests included an extra white space before the uuid in their
golden output files. However commit 48613832ad ("_filter_uuid: Fix
output regression for btrfs/006"), which came later, fixed the regression
in the uuid filter therefore making btrfs/100 and btrfs/101 fail due to
the extra space in their expected golden output files. So just remove the
extra white spaces from the golden output files.
$ ./check btrfs/100
FSTYP -- btrfs
PLATFORM -- Linux/x86_64 debian3 4.2.0-rc5-btrfs-next-13+
MKFS_OPTIONS -- /dev/sdc
MOUNT_OPTIONS -- /dev/sdc /home/fdmanana/btrfs-tests/scratch_1
btrfs/100 4s ... - output mismatch (see .../results//btrfs/100.out.bad)
--- tests/btrfs/100.out 2015-09-22 02:56:35.031470334 +0100
+++ /home/fdmanana/git/hub/xfstests/results//btrfs/100.out.bad...
@@ -1,10 +1,10 @@
QA output created by 100
-Label: none uuid: <UUID>
+Label: none uuid: <UUID>
Total devices <NUM> FS bytes used <SIZE>
devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
devid <DEVID> size <SIZE> used <SIZE> path /dev/mapper/error-test
(...)
Failures: btrfs/100
Failed 1 of 1 tests
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
My fault. I didn't set status=0 when removing the filesystem
checking code from Jan's original test code in commit ed2732f
("fstests: Add test of rename").
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Current code always output "truncfile returned 0" because $? was
modified by previous command. Use $ret to indicate the correct
return value from truncfile.
[dchinner: fix formatting issues, update commit message.]
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
From v3.2.4 onwards, mkfs.xfs defaults to enabling ftype, which
causes xfs/199 to break again. Change the test to store the
features2 fields value and compare that directly against the
bad_features2 value which should be the same.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Seems the same patch was applied twice,
6f55bbd xfs/167: need at least 10GB of scratch space to run
b50473c xfs/167: need at least 10GB of scratch space to run
and there're two _require_fs_space calls in the test, remove one.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Regression test for file read corruption when using compressed extents
that are shared by multiple consecutive ranges of the same file.
The btrfs issue is fixed by the linux kernel patch titled:
"Btrfs: fix read corruption of compressed and shared extents"
Without the corresponding fix the test fails because the second time it
reads the test files it gets different data (some pages are incorrectly
filled with zeroes) from the data it wrote before doing a clean ummount.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Regression test for an ENOSPC issue when attempting to write to a file in
a filesystem without any data block groups allocated.
The btrfs issue is fixed by the linux kernel patch titled
"Btrfs: don't initialize a space info as full to prevent ENOSPC" and the
regression was introduced by the patch titled
"Btrfs: fix block group ->space_info null pointer dereference".
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Currently src/t_truncate_cmtime only tests the truncate down case,
truncate up case should be tested too. A recent ext4 bug shows that we
missed that coverage.
See kernel commit 911af577de4e ("ext4: update c/mtime on truncate up")
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This test case tests if the device delete works with
the failed (EIO) source device. EIO errors are achieved
usign the DM device.
This test would need following btrfs-progs and btrfs
kernel patch
btrfs-progs: device delete to accept devid
Btrfs: device delete by devid
However when btrfs-progs patch is not found this test will
not run, and when kernel patch is not found btrfs-progs
will fail gracefully and thus the test script.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This test case will test to confirm the replace works with
the failed (EIO) replacing source device. EIO condition is
achieved using the DM device.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Controlled EIO from the device is achieved using the dm device.
Helper functions are at common/dmerror.
Broadly steps will include calling _dmerror_init().
_dmerror_init() will use SCRATCH_DEV to create dm linear device and assign
DMERROR_DEV to /dev/mapper/error-test.
When test script is ready to get EIO, the test cases can call
_dmerror_load_table() which then it will load the dm error.
so that reading DMERROR_DEV will cause EIO. After the test case is
complete, cleanup must be done by calling _dmerror_cleanup().
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Calls like fsync() should report failure on partial I/O failure, e.g. a
single failed disk in a raid 0 stripe.
This test is motivated by an XFS bug, and this commit fixed the issue
xfs: return errors from partial I/O failures to files
This case is written by David Jeffery <djeffery@redhat.com> originally.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Btrfs qgroup reserve codes lacks check for rewrite dirty page, causing
every write, even rewriting a uncommitted dirty page, to reserve space.
But only written data will free the reserved space, causing reserved
space leaking.
The bug exists almost from the beginning of btrfs qgroup codes, but
nobody found it.
For example:
1)Write [0, 12K) into file A
reserve 12K space
File A:
0 4K 8K 12K
|<--------dirty-------->|
reserved: 12K
2)Write [0,4K) into file A
0 4K 8K 12K
|<--------dirty-------->|
reserved: 16K <<< Should be 12K
3) Commit transaction
Dirty pages [0,12) written to disk.
Free 12K reserved space.
reserved: 4K <<< Should be 0
This testcase will test such problem.
Kernel fix will need some huge change, so won't be soon.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
For busy-box systems that don't support the extended format options.
Signed-off-by: Ari Sundholm <ari@tuxera.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Add cleanup for seqres.full for new test case template, as sometimes
new testcase may forgot to cleanup seqres.full.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Test renaming of various entry types in directories of various sizes.
Check that filesystem didn't get corrupted.
[dchinner: fixed missing bits from new test template, removed
checking of scratch as harness does that. ]
Signed-off-by: Jan Kara <jack@suse.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
The current _require_meta_uuid() test looks for a failure return
code from xfs_db -x -c "uuid generate" but in fact this exits
with success. (In fact uuid_f always exits with success; perhaps
this needs fixing, but that's in the wild now).
So grep for the string(s) stating that it failed, instead.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
ext4/305 sleeps 3 minutes and does mount/umount loop in background,
which produces lots of logs in dmesg and 3 minutes is not necessary.
Ted pointed out that 30 mount/umount cycles is enough to crash a buggy
kernel, so just limit the mount/umount loop to reduce the runtime. And
now the runtime is about 2s.
Reported-by: Theodore Ts'o <tytso@mit.edu>
Suggested-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
_filter_uuid() get updated and changed output from:
uuid: <UUID>
->
uuid: <UUID>
It is a typo introduced by xfs/077, this patch fixed this.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Reviewed-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Test that if we fsync a file that got one extent partially cloned into a
lower file offset, after a power failure our file has the same content it
had before the power failure and after the extent cloning operation.
This test is motivated by an issue found in btrfs that is fixed by the
linux kernel patch titled:
"Btrfs: fix file read corruption after extent cloning and fsync"
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>