generic/067 mounts $SCRATCH_DEV directly in the test, assuming it's
a block device. generic/299 and generic/300 query the size of
$SCRATCH_DEV by running 'blockdev --getsz $SCRATCH_DEV'.
So add the check to make sure $SCRATCH_DEV is a real block device in
these tests.
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Because we recently changed how mkfs behaves when it gets
incorrect/invalid values, add a feature check to run this test only
on older binaries, which accepts invalid sunit values.
Signed-off-by: Jan Tulak <jtulak@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Test that an incremental send operation does not prematurely issues
rmdir operations under a particular scenario (the rmdir operation is
sent before the target directory is empty).
This issue is fixed by the following patch for the linux kernel:
"Btrfs: incremental send, fix premature rmdir 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, under a particular scenario, an incremental send
operation does not leak memory (which used to emit a warning in
dmesg/syslog).
This is a regression test for a btrfs kernel fix that has the title:
"Btrfs: send, fix warning due to late freeing of orphan_dir_info
structures".
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 after doing radical
changes in the directory hierarchy that involve switching the inode
that directory entries point to.
This test exercises scenarios used to fail in btrfs and are fixed by
the following patches for the linux kernel:
"Btrfs: send, fix failure to move directories with the same name around"
"Btrfs: incremental send, fix invalid paths for rename operations"
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Wrong value is passed to _require_fs_space, which should be in unit
of kilobyte(1024), but passed in unit of gigabyte(1024^3).
Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
An ext4 file system can be created without a journal, but ext4/021
presumes it will contain one. Make that requirement explicit to
avoid unnecessary failures when testing "nojournal" file systems.
Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
We're going to need a bigger log for rmap & reflink on XFS, so
increase the size of the log and the fs appropriately.
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>
Since we're getting rid of the rmapxbt, don't test for it.
Add back the log inode structure.
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>
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>
When btrfs hits EDQUOTA when reserving data space, it will leak
already reserved data space.
This test case will check it by using more restrict enospc_debug
mount option to trigger kernel warning at umount time.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
The test does the following:
Initialize a RAID5 with some data
Re-mount RAID5 degraded with _dev3_ missing and write data.
Save md5sum checkpoint1
Re-mount healthy RAID5
Let balance fix degraded blocks.
Save md5sum checkpoint2
Re-mount RAID1 degraded now with _dev1_ missing.
Save md5sum checkpoint3
Verify if all three md5sum matches
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
The test does the following:
Initialize a RAID1 with some data
Re-mount RAID1 degraded with _dev1_ and write up to
half of the FS capacity
Save md5sum checkpoint1
Re-mount healthy RAID1
Let balance re-silver.
Save md5sum checkpoint2
Re-mount RAID1 degraded with _dev2_
Save md5sum checkpoint3
Verify if all three md5sum match
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
Below patches added helper function to get the requested
number of devices for scratch and spare device
btrfs: add functions to get and put a device for replace target
btrfs: add functions to set and reset required number of SCRATCH_DEV_POOL
This patch makes use of them.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
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>
Test the removal of a dir which contains whiteout from lower dir,
which could crash the kernel.
The following kernel commit fixed this issue
84889d4 ovl: check dentry positiveness in ovl_cleanup_whiteouts()
Reviewed-by: Xiong Zhou <xzhou@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
overlayfs was leaking dentry on non-directories when using the
'default_permissions' mount option, which resulted in "BUG Dentry
still in use".
The following kernel commit fixed it:
ovl: fix dentry leak for default_permissions
Reviewed-by: Xiong Zhou <xzhou@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This test has been removed from the auto group because it fails without
an expected fix. Remove it from the quick group as well, as the quick
group should be a subset of the auto group.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
btrfsprogs v4.5.3 changed the formatting of some error messages.
This patch extends the filter for btrfs prop to handle those.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>