LVM/DM has conniptions when you try to use snapshots on a device
that has DAX capability. It first sets up the underlying device as a
DAX capable mapping (type 3 or DM_TYPE_DAX_BIO_BASED) but because
snapshots require COW and shared mappings, it isn't supported on DAX
capable devices. Hence creating the snapshot device fails because it
requires a type 1 (DM_TYPE_BIO_BASED) device and DM can't change
types on a loaded mapping.
Hence we get this obscure error message in the log:
device-mapper: ioctl: can't change device type (old=3 vs new=1) after initial table load.
and these obscure, unhelpful error messages from the LVM command
outputs:
device-mapper: reload ioctl on (251:0) failed: Invalid argument
Failed to suspend logical volume vg_081/base_081.
Device vg_081-base_081-real (251:1) is used by another device.
Failed to revert logical volume vg_081/base_081.
Aborting. Manual intervention required.
Failed to create snapshot
How to turn off DAX capability is not documented in dmsetup or LVM
man pages, nor is dax mentioned anywhere in
Documentation/admin/device-mapper/ so I have no idea how to tell
LVM/DM "don't try to enable DAX support!".
As such, if the uderlying block device is dax capable, skip this
test.
Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Zorro Lang <zlang@kernel.org>