All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zorro Lang <zlang@redhat.com>
To: Jeff Moyer <jmoyer@redhat.com>
Cc: fstests@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-xfs@vger.kernel.org
Subject: Re: [PATCH V2 1/3] dax/dm: disable testing on devices that don't support dax
Date: Fri, 21 Feb 2020 17:48:01 +0800	[thread overview]
Message-ID: <20200221094801.GJ14282@dhcp-12-102.nay.redhat.com> (raw)
In-Reply-To: <20200220200632.14075-2-jmoyer@redhat.com>

On Thu, Feb 20, 2020 at 03:06:30PM -0500, Jeff Moyer wrote:
> Move the check for dax from the individual target scripts into
> _require_dm_target.  This fixes up a couple of missed tests that are
> failing due to the lack of dax support (such as tests requiring
> dm-snapshot).
> 
> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
> ---
>  common/dmdelay  |  5 -----
>  common/dmerror  |  5 -----
>  common/dmflakey |  5 -----
>  common/dmthin   |  5 -----
>  common/rc       | 11 +++++++++++
>  5 files changed, 11 insertions(+), 20 deletions(-)
> 
> diff --git a/common/dmdelay b/common/dmdelay
> index f1e725b9..66cac1a7 100644
> --- a/common/dmdelay
> +++ b/common/dmdelay
> @@ -7,11 +7,6 @@
>  DELAY_NONE=0
>  DELAY_READ=1
>  
> -echo $MOUNT_OPTIONS | grep -q dax
> -if [ $? -eq 0 ]; then
> -	_notrun "Cannot run tests with DAX on dmdelay devices"
> -fi
> -
>  _init_delay()
>  {
>  	local BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
> diff --git a/common/dmerror b/common/dmerror
> index 426f1e96..7d12e0a1 100644
> --- a/common/dmerror
> +++ b/common/dmerror
> @@ -4,11 +4,6 @@
>  #
>  # common functions for setting up and tearing down a dmerror device
>  
> -echo $MOUNT_OPTIONS | grep -q dax
> -if [ $? -eq 0 ]; then
> -	_notrun "Cannot run tests with DAX on dmerror devices"
> -fi
> -
>  _dmerror_setup()
>  {
>  	local dm_backing_dev=$SCRATCH_DEV
> diff --git a/common/dmflakey b/common/dmflakey
> index 2af3924d..b4e11ae9 100644
> --- a/common/dmflakey
> +++ b/common/dmflakey
> @@ -8,11 +8,6 @@ FLAKEY_ALLOW_WRITES=0
>  FLAKEY_DROP_WRITES=1
>  FLAKEY_ERROR_WRITES=2
>  
> -echo $MOUNT_OPTIONS | grep -q dax
> -if [ $? -eq 0 ]; then
> -	_notrun "Cannot run tests with DAX on dmflakey devices"
> -fi
> -
>  _init_flakey()
>  {
>  	local BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
> diff --git a/common/dmthin b/common/dmthin
> index 7946e9a7..61dd6f89 100644
> --- a/common/dmthin
> +++ b/common/dmthin
> @@ -21,11 +21,6 @@ DMTHIN_POOL_DEV="/dev/mapper/$DMTHIN_POOL_NAME"
>  DMTHIN_VOL_NAME="thin-vol"
>  DMTHIN_VOL_DEV="/dev/mapper/$DMTHIN_VOL_NAME"
>  
> -echo $MOUNT_OPTIONS | grep -q dax
> -if [ $? -eq 0 ]; then
> -	_notrun "Cannot run tests with DAX on dmthin devices"
> -fi
> -
>  _dmthin_cleanup()
>  {
>  	$UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1
> diff --git a/common/rc b/common/rc
> index eeac1355..65cde32b 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -1874,6 +1874,17 @@ _require_dm_target()
>  	_require_sane_bdev_flush $SCRATCH_DEV
>  	_require_command "$DMSETUP_PROG" dmsetup
>  
> +	echo $MOUNT_OPTIONS | grep -q dax
> +	if [ $? -eq 0 ]; then
> +		case $target in
> +		stripe|linear|log-writes)

I've checked all cases which import ./common/dm.* (without dmapi), they all
has _require_dm_target. So this patch is good to me.

And by checking current linux source code:

  0 dm-linear.c      226 .direct_access = linear_dax_direct_access,
  1 dm-log-writes.c 1016 .direct_access = log_writes_dax_direct_access,
  2 dm-stripe.c      486 .direct_access = stripe_dax_direct_access,
  3 dm-target.c      159 .direct_access = io_err_dax_direct_access,

Only linear, stripe and log-writes support direct_access.

Thanks,
Zorro

> +			;;
> +		*)
> +			_notrun "Cannot run tests with DAX on $target devices."
> +			;;
> +		esac
> +	fi
> +
>  	modprobe dm-$target >/dev/null 2>&1
>  
>  	$DMSETUP_PROG targets 2>&1 | grep -q ^$target
> -- 
> 2.19.1
> 


  reply	other threads:[~2020-02-21  9:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-20 20:06 [PATCH V2 0/3] fstests: fixes for 64k pages and dax Jeff Moyer
2020-02-20 20:06 ` [PATCH V2 1/3] dax/dm: disable testing on devices that don't support dax Jeff Moyer
2020-02-21  9:48   ` Zorro Lang [this message]
2020-02-23 15:07     ` Eryu Guan
2020-02-24  6:15       ` Zorro Lang
2020-02-20 20:06 ` [PATCH V2 2/3] t_mmap_collision: fix hard-coded page size Jeff Moyer
2020-02-21 13:53   ` Zorro Lang
2020-02-20 20:06 ` [PATCH V2 3/3] xfs/300: modify test to work on any fs block size Jeff Moyer
2020-02-22  5:31   ` Zorro Lang
2020-02-24 13:46     ` Jeff Moyer
2020-02-26  7:42       ` Zorro Lang
2020-02-20 21:21 ` [PATCH V2 0/3] fstests: fixes for 64k pages and dax Darrick J. Wong
2020-02-21 20:11   ` Jeff Moyer

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=20200221094801.GJ14282@dhcp-12-102.nay.redhat.com \
    --to=zlang@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=jmoyer@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@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.