]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/log
xfstests-dev.git
2 years agoxfs/114: fix missing reflink requires
Darrick J. Wong [Wed, 5 Oct 2022 22:30:44 +0000 (15:30 -0700)]
xfs/114: fix missing reflink requires

This test both requires cp --reflink and the scratch filesystem to
support reflink.  Add the missing _requires calls.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
2 years agogeneric/092: skip test if file allocation unit isn't aligned
Darrick J. Wong [Wed, 5 Oct 2022 22:30:38 +0000 (15:30 -0700)]
generic/092: skip test if file allocation unit isn't aligned

This test exercises allocation behavior when truncating a preallocated
file down to 5M and then up to 7M.  If those two sizes aren't aligned
with the file allocation unit length, then the FIEMAP output will show
blocks beyond EOF.  That will cause trouble with the golden output, so
skip this test if that will be the case.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
2 years agobtrfs: test fiemap on large file with extents shared through a snapshot
Filipe Manana [Fri, 7 Oct 2022 13:53:34 +0000 (14:53 +0100)]
btrfs: test fiemap on large file with extents shared through a snapshot

Verify that fiemap correctly reports the sharedness of extents for a file
with a very large number of extents, spanning many b+tree leaves in the fs
tree, and when the file's subvolume was snapshoted.

Currently this passes on all kernel releases and its purpose is to prevent
and detect regressions in the future, as this actually happened during
recent development on the btrfs' fiemap related code. With this test we
now have better coverage for fiemap when a file is shared through a
snapshot.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
2 years agobtrfs: test active zone tracking
Naohiro Aota [Wed, 5 Oct 2022 05:46:44 +0000 (14:46 +0900)]
btrfs: test active zone tracking

A ZNS device limits the number of active zones, which is the number of
zones can be written at the same time. To deal with the limit, btrfs's
zoned mode tracks which zone (corresponds to a block group on the SINGLE
profile) is active, and finish a zone if necessary.

This test checks if the active zone tracking and the finishing of zones
works properly. First, it fills <number of max active zones> zones
mostly. And, run some data/metadata stress workload to force btrfs to use a
new zone.

This test fails on an older kernel (e.g, 5.18.2) like below.

btrfs/273
[failed, exit status 1]- output mismatch (see /host/btrfs/273.out.bad)
    --- tests/btrfs/273.out     2022-09-15 07:52:18.000000000 +0000
    +++ /host/btrfs/273.out.bad 2022-09-15 07:59:14.290967793 +0000
    @@ -1,2 +1,5 @@
     QA output created by 273
    -Silence is golden
    +stress_data_bgs failed
    +stress_data_bgs_2 failed
    +failed: '/bin/btrfs subvolume snapshot /mnt/scratch /mnt/scratch/snap825'
    +(see /host/btrfs/273.full for details)
    ...
    (Run 'diff -u /var/lib/xfstests/tests/btrfs/273.out /host/btrfs/273.out.bad'  to see the entire diff)

The failure is fixed with a series "btrfs: zoned: fix active zone tracking
issues" [1] (upstream commits from 65ea1b66482f ("block: add bdev_max_segments()
helper") to 2ce543f47843 ("btrfs: zoned: wait until zone is finished when
allocation didn't progress")).

[1] https://lore.kernel.org/linux-btrfs/cover.1657321126.git.naohiro.aota@wdc.com/

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
2 years agocommon: introduce zone_capacity() to return a zone capacity
Naohiro Aota [Wed, 5 Oct 2022 05:46:43 +0000 (14:46 +0900)]
common: introduce zone_capacity() to return a zone capacity

Introduce _zone_capacity() to return a zone capacity of the given address
in the given device (optional). Move _filter_blkzone_report() for it, and
rewrite btrfs/237 with it.

Reviewed-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
2 years agogeneric/299: skip test early if falloc is not supported
Pavel Reichl [Thu, 22 Sep 2022 18:55:02 +0000 (20:55 +0200)]
generic/299: skip test early if falloc is not supported

Move the _require_xfs_io_command "falloc" above the
potencially 'expensive' function _get_max_file_size

Signed-off-by: Pavel Reichl <preichl@redhat.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
2 years agocleanup: remove left files after test finishes
Pavel Reichl [Thu, 22 Sep 2022 18:55:01 +0000 (20:55 +0200)]
cleanup: remove left files after test finishes

Fix file leak in _get_max_file_size - This is obviously mostly
problematic for FS lacking support for sparse files.

There seems to be some seek_sanity_testfile files that are not
cleaned up and take up space:

-rwxr-xr-x. 1 root root 8.0G Sep 22 13:39 seek_sanity_testfile10

g/394: Clean up test files taking space:

-rwxr-xr-x. 1 root root 1.0G Sep 22 14:58 394.1183899
-rwxr-xr-x. 1 root root 1.0G Sep 22 14:58 394.1183899-1
-rwxr-xr-x. 1 root root    0 sep 22 14:58 394.1183899+1

Signed-off-by: Pavel Reichl <preichl@redhat.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>