All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Eryu Guan <eguan@redhat.com>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH] fstests: be compatible with older mkfs.xfs which has no v5 support
Date: Thu, 14 May 2015 12:14:06 +1000	[thread overview]
Message-ID: <20150514021406.GO15721@dastard> (raw)
In-Reply-To: <1431258643-13620-1-git-send-email-eguan@redhat.com>

On Sun, May 10, 2015 at 07:50:43PM +0800, Eryu Guan wrote:
> With the change to CRCs by default, some tests are updated to call mkfs
> with "-m crc=0" option directly, and this breaks testings on older
> distros where mkfs.xfs doesn't have crc support.
> 
> Introduce a new variable to tell if mkfs.xfs supports v5 xfs and do
> tweaks in _scratch_mkfs_xfs_opts() based on it.
> 
> Signed-off-by: Eryu Guan <eguan@redhat.com>
> ---
> 
> This is based on Dave's commit "filter: inode size output of mkfs.xfs can change"
> 
> Tested on upstream kernel with upstream xfsprogs(v5 as default) and on RHEL7(v4
> as default) and on RHEL6(no v5 support), all seem fine, no failures caused by
> crc options.
> 
>  check         | 10 +++++++++-
>  common/rc     |  5 +++++
>  tests/xfs/073 |  4 +++-
>  3 files changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/check b/check
> index 4fa96ed..568c05b 100755
> --- a/check
> +++ b/check
> @@ -505,9 +505,17 @@ for section in $HOST_OPTIONS_SECTIONS; do
>  
>  	if [ ! -z "$SCRATCH_DEV" ]; then
>  	  umount $SCRATCH_DEV 2>/dev/null
> +
> +	  # check if mkfs.xfs supports v5 xfs
> +	  if [ "$FSTYP" == "xfs" ]; then
> +		export XFS_MKFS_HAS_NO_META_SUPPORT=""
> +		if ! _scratch_mkfs -m crc=0 >/dev/null 2>&1; then
> +			export XFS_MKFS_HAS_NO_META_SUPPORT=true
> +		fi
> +	  fi
> +

Shouldn't this be somewhere in common/config, not in the check
script itself?

Also, _scratch_mkfs_xfs_supported already exists for checking
various options exist in mkfs.xfs....

> diff --git a/tests/xfs/073 b/tests/xfs/073
> index 45a3fdf..acac8b8 100755
> --- a/tests/xfs/073
> +++ b/tests/xfs/073
> @@ -156,7 +156,9 @@ _verify_copy $imgs.image $SCRATCH_DEV $SCRATCH_MNT
>  
>  echo 
>  echo === copying scratch device to single target, large ro device
> -${MKFS_XFS_PROG} -m crc=0 -dfile,name=$imgs.source,size=100g | _filter_mkfs 2>/dev/null
> +mkfs_crc_opts="-m crc=0"
> +[ -n "$XFS_MKFS_HAS_NO_META_SUPPORT" ] && mkfs_crc_opts=""
> +${MKFS_XFS_PROG} $mkfs_crc_opts -dfile,name=$imgs.source,size=100g | _filter_mkfs 2>/dev/null

This is kinda messy. Just use if/then/else, it's much easy to read.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  parent reply	other threads:[~2015-05-14  2:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-10 11:50 [PATCH] fstests: be compatible with older mkfs.xfs which has no v5 support Eryu Guan
2015-05-11  3:19 ` Eryu Guan
2015-05-14  2:14 ` Dave Chinner [this message]
2015-05-14  4:40   ` Eryu Guan
2015-05-14 10:24     ` Dave Chinner
2015-05-14 12:28       ` Eryu Guan
2015-05-14  6:42 ` [PATCH v2] " Eryu Guan
2015-05-15  4:29 ` [PATCH v3] " Eryu Guan

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=20150514021406.GO15721@dastard \
    --to=david@fromorbit.com \
    --cc=eguan@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.