FSTests Archive on lore.kernel.org
 help / color / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: djwong@kernel.org, guaneryu@gmail.com
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me
Subject: [PATCH 3/4] common/rc: fix detection of device-mapper/persistent memory incompatibility
Date: Tue, 02 Mar 2021 15:22:50 -0800
Message-ID: <161472737079.3478298.2584850499235911991.stgit@magnolia> (raw)
In-Reply-To: <161472735404.3478298.8179031068431918520.stgit@magnolia>

From: Darrick J. Wong <djwong@kernel.org>

In commit fc7b3903, we tried to make _require_dm_target smart enough to
_notrun tests that require a device mapper target that isn't compatible
with "DAX".  However, as of this writing, the incompatibility stems from
device mapper's unwillingness to switch access modes when running atop
DAX (persistent memory) devices, and has nothing to do with the
filesystem mount options.

Since filesystems supporting DAX don't universally require "dax" in the
mount options to enable that functionality, switch the test to query
sysfs to see if the scratch device supports DAX.

Fixes: fc7b3903 ("dax/dm: disable testing on devices that don't support dax")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 common/rc |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


diff --git a/common/rc b/common/rc
index 7254130f..10e5f40b 100644
--- a/common/rc
+++ b/common/rc
@@ -1889,7 +1889,8 @@ _require_dm_target()
 	_require_sane_bdev_flush $SCRATCH_DEV
 	_require_command "$DMSETUP_PROG" dmsetup
 
-	_normalize_mount_options | egrep -q "dax(=always| |$)"
+	_normalize_mount_options | egrep -q "dax(=always| |$)" || \
+			test -e "/sys/block/$(_short_dev $SCRATCH_DEV)/dax"
 	if [ $? -eq 0 ]; then
 		case $target in
 		stripe|linear|log-writes)


  parent reply index

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02 23:22 [PATCHSET 0/4] fstests: various fixes Darrick J. Wong
2021-03-02 23:22 ` [PATCH 1/4] generic/623: don't fail on core dumps Darrick J. Wong
2021-03-04 14:41   ` Chandan Babu R
2021-03-05  8:30   ` Christoph Hellwig
2021-03-02 23:22 ` [PATCH 2/4] xfs/271: fix test failure on non-reflink filesystems Darrick J. Wong
2021-03-04 15:42   ` Chandan Babu R
2021-03-05  8:31   ` Christoph Hellwig
2021-03-02 23:22 ` Darrick J. Wong [this message]
2021-03-05  8:25   ` [PATCH 3/4] common/rc: fix detection of device-mapper/persistent memory incompatibility Chandan Babu R
2021-03-05  8:33   ` Christoph Hellwig
2021-03-02 23:22 ` [PATCH 4/4] generic/60[78]: ensure the initial DAX file flag state before test Darrick J. Wong
2021-03-05  8:35   ` Chandan Babu R

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=161472737079.3478298.2584850499235911991.stgit@magnolia \
    --to=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=guan@eryu.me \
    --cc=guaneryu@gmail.com \
    --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

FSTests Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/fstests/0 fstests/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 fstests fstests/ https://lore.kernel.org/fstests \
		fstests@vger.kernel.org
	public-inbox-index fstests

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.fstests


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git