Update the group files to annotate those tests which have a
_require_xfs_io_command for punch, collapse, insert, and zero. This
makes it easier to exclude tests that use one of these fallocate
commands. Or if you want to specifically test for those fallocate
commands you can do this.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This adds a regression test for the following kernel patch:
b4678df184b3 ("errseq: Always report a writeback error once")
This is motivated by some rather odd behavior done by the PostgreSQL
project. The main database writers will offload the fsync calls to a
separate process, which can open files after a writeback error has
already occurred.
This used to work with older kernels that reported the error to only
one fd, but with the errseq_t changes we lost the ability to see
errors that occurred before the open. The above patch restores that
behavior.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Test that when we have the no-holes mode enabled and a specific
metadata layout, if we punch a hole and fsync the file, at replay
time the whole hole was preserved.
This issue is fixed by the following btrfs patch for the linux
kernel:
"Btrfs: fix fsync after hole punching when using no-holes feature"
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This is to reproduce a bug of scrub, with which scrub is unable to
repair raid6 corruption as expected.
The kernel side fixes are
Btrfs: make raid6 rebuild retry more
Btrfs: fix scrub to repair raid6 corruption
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Btrfs qgroup also supports to limit the usage of specified qgroups.
It's possible to enable qgroup but doesn't enable limit.
(Most user won't use qgroup limit for various problems)
So add a new test group 'limit' for btrfs, as a subset of existing
'qgroup' group.
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This test case is to reproduce a bug of raid6 reconstruction
process.
The kernel fix are
Btrfs: do not merge rbios if their fail stripe index are not identical
Btrfs: make raid6 rebuild retry more
[eguan: whitespace and indention fix, add 'raid' group]
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Ancient commit f4c697e6406d ("btrfs: return EINVAL if start >
total_bytes in fitrim ioctl") introduced a regression where btrfs
may fail to trim any free space in existing block groups.
It's caused by confusion with btrfs_super_block->total_bytes and
btrfs logical address space.
Unlike physical address, any aligned bytenr in range [0, U64_MAX) is
valid in btrfs logical address space, and it's chunk mapping
mechanism of btrfs to handle the logical<->physical mapping.
The test case will craft a btrfs with the following features:
0) Single data/meta profile
Make trimmed bytes reporting and chunk allocation more predictable.
1) All chunks start beyond super_block->total_bytes (1G)
By relocating these blocks several times.
2) Unallocated space is less than 50% of the whole fs
3) Fragmented data chunks
Data chunks will be full of fragments, 50% of data chunks will be
free space.
So in theory fstrim should be able to trim over 50% space of the fs.
(after fix, 64% of the fs can be trimmed)
While the regression makes btrfs only able to trim unallocated
space, which is less than 50% of the total space.
(without fix, it's only 31%)
Fixed by patch named "btrfs: Ensure btrfs_trim_fs can trim the whole
fs".
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Test that an incremental send operation works if a file that has
multiple hard links has some of its hard links renamed in the send
snapshot, with one of them getting the same path that some other
inode had in the send snapshot.
At the moment this test fails on btrfs and a fix is provived by a
linux kernel patch titled:
"Btrfs: incremental send, fix wrong unlink path after renaming file"
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Make sure missing device is included in the alloc list when it is
scanned on a mounted FS.
This test case needs btrfs kernel patch which is in the ML
[PATCH] btrfs: handle dynamically reappearing missing device
Without the kernel patch, the test will run, but reports as
failed, as the device scanned won't appear in the alloc_list.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This test case writes into pre-allocated space, then tries to
fallocate some more within the defined quota limit. Currently
(4.14-rc7) this fails with EDQUOT due to quota reservation leakage
when writing into pre- allocated space.
A possible fix has been sent to the ML as "btrfs: Fix quota
reservation leak on preallocated files"
Signed-off-by: Justin Maggard <jmaggard@netgear.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This test case does some concurrent send/receives with qgroups
enabled. Currently (4.14-rc7) this usually results in btrfs check
errors, and often also results in a WARN_ON in
record_root_in_trans().
Bisecting points to 6426c7ad697d (btrfs: qgroup: Fix qgroup
accounting when creating snapshot) as the culprit.
Signed-off-by: Justin Maggard <jmaggard@netgear.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
No agreement on how to fix it in the foreseeable future. So remove
it from auto group to prevent newbie tester from spending days
waiting it to finish.
Reported-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Currently running 'btrfs device delete' can end up with losing data
raid profile (if any), this test is to reproduce the problem.
The fix is
"Btrfs: avoid losing data raid profile when deleting a device"
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
We had a bug in btrfs compression code which could end up with a
kernel panic.
This is adding a regression test for the bug and I've also sent a
kernel patch to fix the bug.
The patch is "Btrfs: fix kernel oops while reading compressed data".
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Test that an incremental send/receive operation will not fail when the
destination filesystem has compression enabled and the source filesystem
has a 4K extent at a file offset 0 that is not compressed and that is
shared.
This currently fails on btrfs and is fixed by the following patch for the
linux kernel:
"Btrfs: incremental send, fix emission of invalid clone operations"
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Test that a direct IO write works against raid5/6 filesystems and that
after the write operation we are able to read back the correct data
and scrub operations don't find any errors.
This test is motivated by a regression introduced in the merge window
for the 4.13 linux kernel, which was undetected by the current set of
test cases. The issue is fixed by the following patch:
"Btrfs: fix write corruption due to bio cloning on raid5/6"
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Test that an incremental send/receive operation works correctly after
moving some directory inode A, renaming a regular file inode B into the
old name of inode A and finally creating a new hard link for inode B at
directory inode A.
This issue is fixed by the following patch for the linux kernel:
"Btrfs: incremental send, fix invalid path for link commands"
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
For btrfs, we can test how it reports data writeback errors on fsync by
implementing a suggestion from Chris Mason:
Build a filesystem with 2 devices that stripes the data across
both devices, but mirrors metadata across both. Then, make one
of the devices fail and test what it does.
[eguan: add comments about creating btrfs with "-d raid0 -m raid1"]
Cc: Chris Mason <clm@fb.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Test that an incremental send works if we rename some directory inode A
and then rename some file inode B to the name inode A had, for the case
where the directory inode A is an ancestor of inode B in the parent
snapshot.
This issue is fixed by the following patch for the linux kernel:
"Btrfs: incremental send, fix invalid path for unlink commands"
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Test that an incremental send operation works correctly when an inode A
is renamed, a new hard link added to it and some other inode B is renamed
to the old name of inode A.
The btrfs bug is fixed by the following patch for the linux kernel:
"Btrfs: send, fix invalid path after renaming and linking file"
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This is a regression test for patch "Btrfs: fix delalloc accounting
leak caused by u32 overflow". It creates a bunch of delalloc extents
and merges them together to make sure the accounting is done right.
[eguan: use $XFS_IO_PROG instead of xfs_io]
Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This is to test whether buffered read retry-repair code is able to
work in raid1 case as expected.
Please note that without checksum, btrfs doesn't know if the data
used to repair is correct, so repair is more of resync which makes
sure that both of the copy has the same content.
Commit 20a7db8ab3f2 ("btrfs: add dummy callback for
readpage_io_failed and drop checks") introduced the regression.
The upstream fix is commit 9d0d1c8b1c9d ("Btrfs: bring back repair
during read")
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Filipe Manana <fdmanana@gmail.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Commit 2dabb3248453 ("Btrfs: Direct I/O read: Work on sectorsized
blocks") introduced this regression. It'd cause 'Segmentation
fault' error.
The upstream fix is commit 97bf5a5589aa ("Btrfs: fix segment fault
when doing dio read")
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Filipe Manana <fdmanana@gmail.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This case tests whether buffered read can repair the bad copy if we
have a good copy.
Commit 20a7db8ab3f2 ("btrfs: add dummy callback for readpage_io_failed
and drop checks") introduced the regression.
The upstream fix is commit 9d0d1c8b1c9d ("Btrfs: bring back repair
during read")
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Filipe Manana <fdmanana@gmail.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>