From: Disha Goel Date: Mon, 8 Jun 2026 10:23:28 +0000 (+0530) Subject: common/defrag: skip defrag tests on DAX-enabled filesystems X-Git-Tag: v2026.06.21^0 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=acb6d4cb84205a8e3f19ca470cfcf7bf6d93a509;p=xfstests-dev.git common/defrag: skip defrag tests on DAX-enabled filesystems Online defragmentation is not supported on ext4 DAX-enabled filesystems. The ext4 defrag ioctl (EXT4_IOC_MOVE_EXT) returns EOPNOTSUPP when used on DAX files. Add an ext4-specific check in _require_defrag() to skip tests when DAX is enabled, avoiding false failures on ext4/301-304, ext4/308, and generic/018. XFS defrag works with DAX, so this check is ext4-specific. Suggested-by: Darrick J. Wong Signed-off-by: Disha Goel Reviewed-by: Ojaswin Mujoo Reviewed-by: Zorro Lang Signed-off-by: Zorro Lang --- diff --git a/common/defrag b/common/defrag index 055d0d0e..baf05d94 100644 --- a/common/defrag +++ b/common/defrag @@ -13,6 +13,8 @@ _require_defrag() DEFRAG_PROG="$XFS_FSR_PROG" ;; ext4) + __scratch_uses_fsdax && _notrun "ext4 online defrag not supported with DAX" + testfile="$TEST_DIR/$$-test.defrag" donorfile="$TEST_DIR/$$-donor.defrag" bsize=`_get_block_size $TEST_DIR`