Skip to contentSkip to conversation

common/defrag: skip defrag tests on DAX-enabled filesystems

PATCH In review Disha Goel 2 participants 2 messages Jun 8 – Jun 17 VFS

lore
Share & tools
lore

Disha Goel

author
#0 lore raw

PATCH v3 1/1 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.

---
Changes in v3:
- Move the DAX check inside the ext4 case statement as suggested by Darrick

 common/defrag | 2 ++
 1 file changed, 2 insertions(+)
common/defrag +2 -0
index 055d0d0e..baf05d94 100644
@@ -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`
Signature · 1 line
2.45.1
Reviewed-by on v3 1/1
#1 lore raw
Quoted 10 lines · Disha Goel

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.

Quoted 7 lines

---
Changes in v3:
- Move the DAX check inside the ext4 case statement as suggested by Darrick

Make sense to me,

Quoted 21 lines
 common/defrag | 2 ++
 1 file changed, 2 insertions(+)
common/defrag +2 -0
index 055d0d0e..baf05d94 100644
@@ -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`
Signature · 1 line
2.45.1