From: Anand Jain <anand.jain@oracle.com>
To: fdmanana@kernel.org, fstests@vger.kernel.org
Cc: linux-btrfs@vger.kernel.org, Filipe Manana <fdmanana@suse.com>
Subject: Re: [PATCH] btrfs/287: make the test work when compression is enabled
Date: Wed, 30 Oct 2024 10:10:07 +0800 [thread overview]
Message-ID: <49e0218a-4b57-49a0-995b-abe287bc3d84@oracle.com> (raw)
In-Reply-To: <9991dab5ca241c17f531f49dab5dbaa6e9146c45.1730220754.git.fdmanana@suse.com>
On 30/10/24 01:21, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
>
> When running btrfs/287 with compression enabled (mount options), the test
> fails because it expects to find 4M extents, however compression limits
> the maximum size of extents to 128K, breaking the tests' expectations.
>
> Example:
>
> $ MOUNT_OPTIONS="-o compress" ./check btrfs/287
> FSTYP -- btrfs
> PLATFORM -- Linux/x86_64 debian0 6.12.0-rc4-btrfs-next-177+ #1 SMP PREEMPT_DYNAMIC Thu Oct 24 17:14:37 WEST 2024
> MKFS_OPTIONS -- /dev/sdc
> MOUNT_OPTIONS -- -o compress /dev/sdc /home/fdmanana/btrfs-tests/scratch_1
>
> btrfs/287 2s ... - output mismatch (see /home/fdmanana/git/hub/xfstests/results//btrfs/287.out.bad)
> --- tests/btrfs/287.out 2024-10-19 18:21:30.451644840 +0100
> +++ /home/fdmanana/git/hub/xfstests/results//btrfs/287.out.bad 2024-10-29 16:31:20.926612583 +0000
> @@ -25,22 +25,14 @@
> resolve first extent with ignore offset option:
> inode 257 offset 16777216 root 5
> inode 257 offset 8388608 root 5
> -inode 257 offset 2097152 root 5
> resolve first extent +1M offset:
> -inode 257 offset 17825792 root 5
> -inode 257 offset 9437184 root 5
> ...
> (Run 'diff -u /home/fdmanana/git/hub/xfstests/tests/btrfs/287.out /home/fdmanana/git/hub/xfstests/results//btrfs/287.out.bad' to see the entire diff)
>
> HINT: You _MAY_ be missing kernel fix:
> 0cad8f14d70c btrfs: fix backref walking not returning all inode refs
>
> Ran: btrfs/287
> Failures: btrfs/287
> Failed 1 of 1 tests
>
> Fix this by creating the two 4M extents with fallocate, so that the test
> works regardless of compression being enabled or not.
>
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Thanks, Anand
> ---
> tests/btrfs/287 | 10 +++++-----
> tests/btrfs/287.out | 4 ----
> 2 files changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/tests/btrfs/287 b/tests/btrfs/287
> index e88f4e0a..a51b31ed 100755
> --- a/tests/btrfs/287
> +++ b/tests/btrfs/287
> @@ -7,13 +7,14 @@
> # Test btrfs' logical to inode ioctls (v1 and v2).
> #
> . ./common/preamble
> -_begin_fstest auto quick snapshot clone punch logical_resolve
> +_begin_fstest auto quick snapshot clone prealloc punch logical_resolve
>
> . ./common/filter.btrfs
> . ./common/reflink
>
> _require_btrfs_scratch_logical_resolve_v2
> _require_scratch_reflink
> +_require_xfs_io_command "falloc"
> _require_xfs_io_command "fpunch"
>
> # This is a test case to test the logical to ino ioctl in general but it also
> @@ -42,10 +43,9 @@ _scratch_mount
> #
> # 1) One 4M extent covering the file range [0, 4M)
> # 2) Another 4M extent covering the file range [4M, 8M)
> -$XFS_IO_PROG -f -c "pwrite -S 0xab -b 4M 0 4M" \
> - -c "fsync" \
> - -c "pwrite -S 0xcd -b 4M 4M 8M" \
> - -c "fsync" $SCRATCH_MNT/foo | _filter_xfs_io
> +$XFS_IO_PROG -f -c "falloc 0 4M" \
> + -c "falloc 4M 4M" \
> + $SCRATCH_MNT/foo
>
> echo "resolve first extent:"
> first_extent_bytenr=$(_btrfs_get_file_extent_item_bytenr "$SCRATCH_MNT/foo" 0)
> diff --git a/tests/btrfs/287.out b/tests/btrfs/287.out
> index 4814594f..48541f7e 100644
> --- a/tests/btrfs/287.out
> +++ b/tests/btrfs/287.out
> @@ -1,8 +1,4 @@
> QA output created by 287
> -wrote 4194304/4194304 bytes at offset 0
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 8388608/8388608 bytes at offset 4194304
> -XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> resolve first extent:
> inode 257 offset 0 root 5
> resolve second extent:
prev parent reply other threads:[~2024-10-30 2:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-29 17:21 [PATCH] btrfs/287: make the test work when compression is enabled fdmanana
2024-10-30 2:10 ` Anand Jain [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49e0218a-4b57-49a0-995b-abe287bc3d84@oracle.com \
--to=anand.jain@oracle.com \
--cc=fdmanana@kernel.org \
--cc=fdmanana@suse.com \
--cc=fstests@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox