common/rc: fix detection of device-mapper/persistent memory incompatibility
authorDarrick J. Wong <djwong@kernel.org>
Tue, 2 Mar 2021 23:22:50 +0000 (15:22 -0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 7 Mar 2021 16:36:20 +0000 (00:36 +0800)
commite05491b34134f37e0e6f20b50b58014c4ec7b70d
treeb26e73511bc8744d4f97152ae23f16e3163d47af
parent5c076a5adbd15dc06128d7eea2747677b5eba704
common/rc: fix detection of device-mapper/persistent memory incompatibility

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>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/rc