[PATCH] common/defrag: Skip defrag tests on DAX-enabled filesystems

Disha Goel <[email protected]>
Newsgroups org.kernel.vger.fstests,org.kernel.vger.linux-ext4,org.kernel.vger.linux-fsdevel
Message-ID <[email protected]>
Online defragmentation is not supported on DAX-enabled filesystems
because DAX bypasses the page cache required for defrag operations.

Add check in _require_defrag() to skip tests when DAX is enabled,
avoiding false failures on ext4/301-304, ext4/308 and generic/018.

Signed-off-by: Disha Goel <[email protected]>
---
 common/defrag | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/common/defrag b/common/defrag
index 055d0d0e..28db2f7a 100644
--- a/common/defrag
+++ b/common/defrag
@@ -6,6 +6,10 @@
 
 _require_defrag()
 {
+    # Defragmentation is not supported on DAX-enabled filesystems
+    if echo "$MOUNT_OPTIONS" | grep -qw "dax"; then
+        _notrun "Defragmentation not supported on DAX-enabled filesystem"
+    fi
     case "$FSTYP" in
     xfs)
         # xfs_fsr does preallocates, require "falloc"
-- 
2.45.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.