]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
btrfs/280: run defrag after creating file to get expected extent layout
authorFilipe Manana <fdmanana@suse.com>
Wed, 5 Jun 2024 11:26:20 +0000 (12:26 +0100)
committerZorro Lang <zlang@kernel.org>
Fri, 7 Jun 2024 10:19:41 +0000 (18:19 +0800)
commit887f00615ac4989b6ad872b987cc1a352f7a4e82
tree96d5e2161ddc4d0d8404a9a556c1971ffb9e58ad
parentf50e6a3a7138332989821b1963e52ca9ccd131dc
btrfs/280: run defrag after creating file to get expected extent layout

The test writes a 128M file and expects to end up with 1024 extents, each
with a size of 128K, which is the maximum size for compressed extents.
Generally this is what happens, but often it's possibly for writeback to
kick in while creating the file (due to memory pressure, or something
calling sync in parallel, etc) which may result in creating more and
smaller extents, which makes the test fail since its golden output
expects exactly 1024 extents with a size of 128K each.

So to work around run defrag after creating the file, which will ensure
we get only 128K extents in the file.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Disseldorp <ddiss@suse.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/btrfs/280