From: "Darrick J. Wong" <djwong@kernel.org>
To: Ritesh Harjani <riteshh@linux.ibm.com>
Cc: fstests@vger.kernel.org, linux-ext4@vger.kernel.org
Subject: Re: [PATCH 5/9] generic/031: Fix the test case for 64k blocksize config
Date: Wed, 30 Jun 2021 08:50:01 -0700 [thread overview]
Message-ID: <20210630155001.GA13743@locust> (raw)
In-Reply-To: <efd1594eeec7b893c47865ce5a94c25dc94dac28.1623651783.git.riteshh@linux.ibm.com>
On Mon, Jun 14, 2021 at 11:58:09AM +0530, Ritesh Harjani wrote:
> This test fails with blocksize 64k since the test assumes 4k blocksize
> in fcollapse param. This patch fixes that and also tests for 64k
> blocksize.
>
> Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
> ---
> tests/generic/031 | 37 ++++++++++++++++++----
> tests/generic/031.out.64k | 19 +++++++++++
> tests/generic/{031.out => 031.out.default} | 0
> 3 files changed, 49 insertions(+), 7 deletions(-)
> create mode 100644 tests/generic/031.out.64k
> rename tests/generic/{031.out => 031.out.default} (100%)
>
> diff --git a/tests/generic/031 b/tests/generic/031
> index db84031b..40cb23af 100755
> --- a/tests/generic/031
> +++ b/tests/generic/031
> @@ -8,6 +8,7 @@
> # correctly written and aren't left behind causing invalidation or data
> # corruption issues.
> #
> +seqfull=$0
> seq=`basename $0`
> seqres=$RESULT_DIR/$seq
> echo "QA output created by $seq"
> @@ -39,12 +40,35 @@ testfile=$SCRATCH_MNT/testfile
> _scratch_mkfs > /dev/null 2>&1
> _scratch_mount
>
> -$XFS_IO_PROG -f \
> - -c "pwrite 185332 55756" \
> - -c "fcollapse 28672 40960" \
> - -c "pwrite 133228 63394" \
> - -c "fcollapse 0 4096" \
> -$testfile | _filter_xfs_io
> +# fcollapse need offset and len to be multiple of blocksize for filesystems
> +# hence make this test work with 64k blocksize as well.
> +blksz=$(_get_block_size $SCRATCH_MNT)
> +
> +rm -f $seqfull.out
> +if [ "$blksz" -eq 65536 ]; then
> + ln -s $seq.out.64k $seqfull.out
> +else
> + ln -s $seq.out.default $seqfull.out
> +fi
> +
> +if [[ $blksz -le 4096 ]]; then
> + $XFS_IO_PROG -f \
> + -c "pwrite 185332 55756" \
> + -c "fcollapse 28672 40960" \
> + -c "pwrite 133228 63394" \
> + -c "fcollapse 0 4096" \
> + $testfile | _filter_xfs_io
> +elif [[ $blksz -eq 65536 ]]; then
> + fact=$blksz/4096
What if the blocksize is 32k?
--D
> + $XFS_IO_PROG -f \
> + -c "pwrite $((185332*fact + 12)) $((55756*fact + 12))" \
> + -c "fcollapse $((28672 * fact)) $((40960 * fact))" \
> + -c "pwrite $((133228 * fact + 12)) $((63394 * fact + 12))" \
> + -c "fcollapse 0 $((4096 * fact))" \
> + $testfile | _filter_xfs_io
> +else
> + _notrun "blocksize not supported"
> +fi
>
> echo "==== Pre-Remount ==="
> hexdump -C $testfile
> @@ -54,4 +78,3 @@ hexdump -C $testfile
>
> status=0
> exit
> -
> diff --git a/tests/generic/031.out.64k b/tests/generic/031.out.64k
> new file mode 100644
> index 00000000..7dfcfe41
> --- /dev/null
> +++ b/tests/generic/031.out.64k
> @@ -0,0 +1,19 @@
> +QA output created by 031
> +wrote 892108/892108 bytes at offset 2965324
> +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> +wrote 1014316/1014316 bytes at offset 2131660
> +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> +==== Pre-Remount ===
> +00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
> +*
> +001f86c0 00 00 00 00 00 00 00 00 00 00 00 00 cd cd cd cd |................|
> +001f86d0 cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd |................|
> +*
> +002fdc18
> +==== Post-Remount ==
> +00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
> +*
> +001f86c0 00 00 00 00 00 00 00 00 00 00 00 00 cd cd cd cd |................|
> +001f86d0 cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd cd |................|
> +*
> +002fdc18
> diff --git a/tests/generic/031.out b/tests/generic/031.out.default
> similarity index 100%
> rename from tests/generic/031.out
> rename to tests/generic/031.out.default
> --
> 2.31.1
>
next prev parent reply other threads:[~2021-06-30 15:50 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-14 6:28 [PATCH 0/9] 64K blocksize related fixes Ritesh Harjani
2021-06-14 6:28 ` [PATCH 1/9] ext4/003: Fix this test on 64K platform for dax config Ritesh Harjani
2021-06-30 16:27 ` Theodore Ts'o
2021-07-08 6:24 ` Ritesh Harjani
2021-07-08 12:51 ` Theodore Ts'o
2021-06-14 6:28 ` [PATCH 2/9] ext4/027: Correct the right code of block and inode bitmap Ritesh Harjani
2021-06-14 16:40 ` Darrick J. Wong
2021-06-14 6:28 ` [PATCH 3/9] ext4/306: Add -b blocksize parameter too to avoid failure with DAX config Ritesh Harjani
2021-06-30 16:29 ` Theodore Ts'o
2021-06-14 6:28 ` [PATCH 4/9] ext4/022: exclude this test for dax config on 64KB pagesize platform Ritesh Harjani
2021-06-30 16:36 ` Theodore Ts'o
2021-06-14 6:28 ` [PATCH 5/9] generic/031: Fix the test case for 64k blocksize config Ritesh Harjani
2021-06-30 15:50 ` Darrick J. Wong [this message]
2021-06-30 17:18 ` Theodore Ts'o
2021-07-08 9:49 ` Ritesh Harjani
2021-06-14 6:28 ` [PATCH 6/9] gitignore: Add 031.out file to .gitignore Ritesh Harjani
2021-06-30 16:36 ` Theodore Ts'o
2021-06-14 6:28 ` [PATCH 7/9] generic/620: Remove -b blocksize option for ext4 Ritesh Harjani
2021-06-30 17:07 ` Theodore Ts'o
2021-07-08 10:01 ` Ritesh Harjani
2021-06-14 6:28 ` [PATCH 8/9] common/attr: Cleanup end of line whitespaces issues Ritesh Harjani
2021-06-30 15:50 ` Darrick J. Wong
2021-06-30 17:19 ` Theodore Ts'o
2021-06-14 6:28 ` [PATCH 9/9] common/attr: Reduce MAX_ATTRS to leave some overhead for 64K blocksize Ritesh Harjani
2021-06-30 15:51 ` Darrick J. Wong
2021-06-30 19:20 ` Theodore Ts'o
2021-07-09 5:12 ` Ritesh Harjani
2021-06-30 13:30 ` [PATCH 0/9] 64K blocksize related fixes Ritesh Harjani
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=20210630155001.GA13743@locust \
--to=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=riteshh@linux.ibm.com \
/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;
as well as URLs for NNTP newsgroup(s).