Skip to contentSkip to conversation

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

PATCH Superseded Disha Goel 3 participants 5 messages Jun 2 – Jun 3 VFS

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Disha Goel

author
#0 lore raw

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

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.

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

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.

Looks good Disha, feel free to add:

One small comment:

common/defrag line 9

Quoted 13 lines
---
 common/defrag | 4 ++++
 1 file changed, 4 insertions(+)
common/defrag +1 -0
index 055d0d0e..28db2f7a 100644
@@ -6,6 +6,10 @@
 
 _require_defrag()
 {
+    # Defragmentation is not supported on DAX-enabled filesystems

I think this comment is not needed as _notrun explains it already

Quoted 9 lines
common/defrag +3 -0
+    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"
Signature · 1 line
2.45.1
author
#2 lore raw
Quoted 24 lines · Ojaswin Mujoo
Quoted 7 lines · Disha Goel

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.

Looks good Disha, feel free to add:

One small comment:

Quoted 10 lines
---
  common/defrag | 4 ++++
  1 file changed, 4 insertions(+)
common/defrag +0 -0
index 055d0d0e..28db2f7a 100644
@@ -6,6 +6,10 @@
 
Quoted 5 lines

common/defrag line 9

Quoted 3 lines
common/defrag +1 -0
  _require_defrag()
  {
+    # Defragmentation is not supported on DAX-enabled filesystems

I think this comment is not needed as _notrun explains it already

Thanks, I'll fix this in v2.

Quoted 10 lines
Quoted 10 lines
common/defrag +3 -0
+    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"
Signature · 1 line
2.45.1
Signature · 2 lines
Regards,
Disha
#3 lore raw
In reply to Disha Goel
Quoted 16 lines · Disha Goel

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.

---
 common/defrag | 4 ++++
 1 file changed, 4 insertions(+)
common/defrag +0 -0
index 055d0d0e..28db2f7a 100644

common/defrag line 12

Quoted 7 lines
common/defrag +4 -0
@@ -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

Defrag doesn't work on XFS on DAX as well? It seems to work fine on my VMs...

<confused>

--D

Quoted 7 lines
common/defrag +0 -0
     case "$FSTYP" in
     xfs)
         # xfs_fsr does preallocates, require "falloc"
Signature · 1 line
2.45.1
author
#4 lore raw
Quoted 18 lines · Darrick J. Wong
Quoted 17 lines · Disha Goel

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.

---
  common/defrag | 4 ++++
  1 file changed, 4 insertions(+)
common/defrag +0 -0
index 055d0d0e..28db2f7a 100644
@@ -6,6 +6,10 @@
 
Quoted 10 lines

common/defrag line 12

Quoted 6 lines
common/defrag +4 -0
  _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

Defrag doesn't work on XFS on DAX as well? It seems to work fine on my VMs...

Thank you for pointing this out. You're right — I missed that xfs defrag works fine with dax.

I'll fix this in v2 to only skip for ext4.

Quoted 11 lines

<confused>

--D

Quoted 7 lines
common/defrag +0 -0
      case "$FSTYP" in
      xfs)
          # xfs_fsr does preallocates, require "falloc"
Signature · 1 line
2.45.1
Signature · 2 lines
Regards,
Disha