fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zorro Lang <zlang@redhat.com>
To: Anthony Iliopoulos <ailiopoulos@suse.com>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH v2] xfs/513: fix allocsize on archs with pagesize larger than blocksize
Date: Sat, 7 Mar 2020 22:14:30 +0800	[thread overview]
Message-ID: <20200307141430.GC14282@dhcp-12-102.nay.redhat.com> (raw)
In-Reply-To: <20200307105457.24688-1-ailiopoulos@suse.com>

On Sat, Mar 07, 2020 at 11:54:57AM +0100, Anthony Iliopoulos wrote:
> The minimum accepted allocsize mount option value is page size, which
> causes the particular test to fail in architectures where page size >
> block size. Fix it by basing the value on the platform page size rather
> than the block size as obtained from mkfs. In addition add a filter so
> that different values can be used without breaking the golden output.
> 
> Signed-off-by: Anthony Iliopoulos <ailiopoulos@suse.com>
> ---

Looks good to me.

Reviewed-by: Zorro Lang <zlang@redhat.com>

> 
> Changes from v1 -> v2:
> 
> - renamed filter_pagesz to filter_xfs_opt
> - renamed PAGE_SIZE to PAGESIZE
> 
>  tests/xfs/513     | 14 ++++++++++----
>  tests/xfs/513.out |  2 +-
>  2 files changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/tests/xfs/513 b/tests/xfs/513
> index 70bc2f1c..094d0c6c 100755
> --- a/tests/xfs/513
> +++ b/tests/xfs/513
> @@ -68,6 +68,11 @@ filter_loop()
>  	    -e "s,\B$LOOP_SPARE_DEV,LOOP_SPARE_DEV,g"
>  }
>  
> +filter_xfs_opt()
> +{
> +	sed -e "s,allocsize=$pagesz,allocsize=PAGESIZE,g"
> +}
> +
>  # avoid the effection from MKFS_OPTIONS
>  MKFS_OPTIONS=""
>  do_mkfs()
> @@ -165,7 +170,7 @@ do_test()
>  	# Print each argument, include nil ones
>  	echo -n "TEST:" | tee -a $seqres.full
>  	for i in "$@";do
> -		echo -n " \"$i\"" | filter_loop | tee -a $seqres.full
> +		echo -n " \"$i\"" | filter_loop | filter_xfs_opt | tee -a $seqres.full
>  	done
>  	echo | tee -a $seqres.full
>  
> @@ -180,11 +185,12 @@ echo "** start xfs mount testing ..."
>  # Test allocsize=size
>  # Valid values for this option are page size (typically 4KiB) through to 1GiB
>  do_mkfs
> -if [ $dbsize -ge 1024 ];then
> -	blsize="$((dbsize / 1024))k"
> +pagesz=$(get_page_size)
> +if [ $pagesz -ge 1024 ];then
> +	pagesz="$((pagesz / 1024))k"
>  fi
>  do_test "" pass "allocsize" "false"
> -do_test "-o allocsize=$blsize" pass "allocsize=$blsize" "true"
> +do_test "-o allocsize=$pagesz" pass "allocsize=$pagesz" "true"
>  do_test "-o allocsize=1048576k" pass "allocsize=1048576k" "true"
>  do_test "-o allocsize=$((dbsize / 2))" fail
>  do_test "-o allocsize=2g" fail
> diff --git a/tests/xfs/513.out b/tests/xfs/513.out
> index 9be18dd8..6681a7e8 100644
> --- a/tests/xfs/513.out
> +++ b/tests/xfs/513.out
> @@ -5,7 +5,7 @@ QA output created by 513
>  ** start xfs mount testing ...
>  FORMAT: 
>  TEST: "" "pass" "allocsize" "false"
> -TEST: "-o allocsize=4k" "pass" "allocsize=4k" "true"
> +TEST: "-o allocsize=PAGESIZE" "pass" "allocsize=PAGESIZE" "true"
>  TEST: "-o allocsize=1048576k" "pass" "allocsize=1048576k" "true"
>  TEST: "-o allocsize=2048" "fail"
>  TEST: "-o allocsize=2g" "fail"
> -- 
> 2.16.4
> 


      reply	other threads:[~2020-03-07 14:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-07 10:54 [PATCH v2] xfs/513: fix allocsize on archs with pagesize larger than blocksize Anthony Iliopoulos
2020-03-07 14:14 ` Zorro Lang [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=20200307141430.GC14282@dhcp-12-102.nay.redhat.com \
    --to=zlang@redhat.com \
    --cc=ailiopoulos@suse.com \
    --cc=fstests@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;
as well as URLs for NNTP newsgroup(s).