public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Zorro Lang <zlang@redhat.com>
To: fstests@vger.kernel.org
Subject: Re: [PATCH V2] fstests: _require_dm_target should not always skip DAX capable devices
Date: Wed, 27 Oct 2021 20:04:46 +0800	[thread overview]
Message-ID: <20211027120446.ytl7gl3emfpy5x34@fedora> (raw)
In-Reply-To: <20211027013842.GC4821@dread.disaster.area>

On Wed, Oct 27, 2021 at 12:38:42PM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
> 
> Recent changes have turned off all dm-error, dm-thin and dm-flakey
> tests on pmem devices even when we are not explicitly testing DAX.
> This is a regression resulting in a large number of log recovery
> tests no longer running on my pmem-based test VMs. I added the "-o
> dax=never" mount options to these test configs, only to find it
> still would not run the dm tests even though the filesystem will
> never use DAX.
> 
> Fix this so that the dm target DAX test explicitly ignores the
> the block device DAX capability when the filesystem is mounted with
> dax=never and hence we can use all the dm targets when the tests are
> being run with FSDAX disabled.
> 
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> ---

Make sense.

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

> Version 2:
> -use -w for grep command to do exact word matching for options.
> 
>  common/rc | 21 +++++++++++++++------
>  1 file changed, 15 insertions(+), 6 deletions(-)
> 
> diff --git a/common/rc b/common/rc
> index 7f693d39..75197453 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -1965,12 +1965,19 @@ _require_sane_bdev_flush()
>  }
>  
>  # Decide if the scratch filesystem is likely to be mounted in fsdax mode.
> -# If there's a dax clause in the mount options we assume the test runner
> -# wants us to test DAX; or if the scratch device itself advertises dax mode
> -# in sysfs.
> -__detect_scratch_fsdax()
> +# It goes 3 ways based on mount options::
> +#	1. "dax" or "dax=always" means always test using DAX
> +#	2. "dax=never" means we'll never use DAX
> +#	3. "dax=inode" or nothing means "use scratch dev capability" to
> +#	    determine whether DAX is going to be used.
> +#
> +# Returns 0 if DAX will be used, 1 if DAX is not going to be used.
> +__scratch_uses_fsdax()
>  {
> -	_normalize_mount_options | egrep -q "dax(=always| |$)" && return 0
> +	local ops=$(_normalize_mount_options)
> +
> +	echo $ops | egrep -qw "dax(=always| |$)" && return 0
> +	echo $ops | grep -qw "dax=never" && return 1
>  
>  	local sysfs="/sys/block/$(_short_dev $SCRATCH_DEV)"
>  	test -e "${sysfs}/dax" && return 0
> @@ -1982,6 +1989,8 @@ __detect_scratch_fsdax()
>  _require_dm_target()
>  {
>  	local target=$1
> +	local fsdax
> +	local bdevdax
>  
>  	# require SCRATCH_DEV to be a valid block device with sane BLKFLSBUF
>  	# behaviour
> @@ -1989,7 +1998,7 @@ _require_dm_target()
>  	_require_sane_bdev_flush $SCRATCH_DEV
>  	_require_command "$DMSETUP_PROG" dmsetup
>  
> -	if __detect_scratch_fsdax; then
> +	if __scratch_uses_fsdax; then
>  		case $target in
>  		stripe|linear|log-writes)
>  			;;
> 


      parent reply	other threads:[~2021-10-27 11:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26  2:36 [PATCH] fstests: _require_dm_target should not always skip DAX capable devices Dave Chinner
2021-10-26 15:42 ` Darrick J. Wong
2021-10-26 23:50   ` Dave Chinner
2021-10-27  0:26     ` Darrick J. Wong
2021-10-27  1:38       ` [PATCH V2] " Dave Chinner
2021-10-27  3:17         ` Darrick J. Wong
2021-10-27 12:04         ` 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=20211027120446.ytl7gl3emfpy5x34@fedora \
    --to=zlang@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox