Linux EXT4 FS development
 help / color / mirror / Atom feed
* [PATCH] common/defrag: Skip defrag tests on DAX-enabled filesystems
@ 2026-06-02 10:14 Disha Goel
  2026-06-02 10:38 ` Ojaswin Mujoo
  2026-06-02 20:09 ` Darrick J. Wong
  0 siblings, 2 replies; 5+ messages in thread
From: Disha Goel @ 2026-06-02 10:14 UTC (permalink / raw)
  To: fstests; +Cc: linux-ext4, linux-fsdevel, ritesh.list, ojaswin, 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.

Signed-off-by: Disha Goel <disgoel@linux.ibm.com>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] common/defrag: Skip defrag tests on DAX-enabled filesystems
  2026-06-02 10:14 [PATCH] common/defrag: Skip defrag tests on DAX-enabled filesystems Disha Goel
@ 2026-06-02 10:38 ` Ojaswin Mujoo
  2026-06-03 14:22   ` Disha Goel
  2026-06-02 20:09 ` Darrick J. Wong
  1 sibling, 1 reply; 5+ messages in thread
From: Ojaswin Mujoo @ 2026-06-02 10:38 UTC (permalink / raw)
  To: Disha Goel; +Cc: fstests, linux-ext4, linux-fsdevel, ritesh.list

On Tue, Jun 02, 2026 at 03:44:18PM +0530, Disha Goel wrote:
> 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 <disgoel@linux.ibm.com>

Looks good Disha, feel free to add:

Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>

One small comment:
> ---
>  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

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

> +    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
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] common/defrag: Skip defrag tests on DAX-enabled filesystems
  2026-06-02 10:14 [PATCH] common/defrag: Skip defrag tests on DAX-enabled filesystems Disha Goel
  2026-06-02 10:38 ` Ojaswin Mujoo
@ 2026-06-02 20:09 ` Darrick J. Wong
  2026-06-03 14:20   ` Disha Goel
  1 sibling, 1 reply; 5+ messages in thread
From: Darrick J. Wong @ 2026-06-02 20:09 UTC (permalink / raw)
  To: Disha Goel; +Cc: fstests, linux-ext4, linux-fsdevel, ritesh.list, ojaswin, xfs

On Tue, Jun 02, 2026 at 03:44:18PM +0530, Disha Goel wrote:
> 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 <disgoel@linux.ibm.com>
> ---
>  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

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

<confused>

--D

>      case "$FSTYP" in
>      xfs)
>          # xfs_fsr does preallocates, require "falloc"
> -- 
> 2.45.1
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] common/defrag: Skip defrag tests on DAX-enabled filesystems
  2026-06-02 20:09 ` Darrick J. Wong
@ 2026-06-03 14:20   ` Disha Goel
  0 siblings, 0 replies; 5+ messages in thread
From: Disha Goel @ 2026-06-03 14:20 UTC (permalink / raw)
  To: Darrick J. Wong
  Cc: fstests, linux-ext4, linux-fsdevel, ritesh.list, ojaswin, xfs

On 03/06/26 1:39 am, Darrick J. Wong wrote:
> On Tue, Jun 02, 2026 at 03:44:18PM +0530, Disha Goel wrote:
>> 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 <disgoel@linux.ibm.com>
>> ---
>>   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
> 
> 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.

> <confused>
> 
> --D
> 
>>       case "$FSTYP" in
>>       xfs)
>>           # xfs_fsr does preallocates, require "falloc"
>> -- 
>> 2.45.1
>>
>>

-- 
Regards,
Disha


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] common/defrag: Skip defrag tests on DAX-enabled filesystems
  2026-06-02 10:38 ` Ojaswin Mujoo
@ 2026-06-03 14:22   ` Disha Goel
  0 siblings, 0 replies; 5+ messages in thread
From: Disha Goel @ 2026-06-03 14:22 UTC (permalink / raw)
  To: Ojaswin Mujoo; +Cc: fstests, linux-ext4, linux-fsdevel, ritesh.list

On 02/06/26 4:08 pm, Ojaswin Mujoo wrote:
> On Tue, Jun 02, 2026 at 03:44:18PM +0530, Disha Goel wrote:
>> 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 <disgoel@linux.ibm.com>
> 
> Looks good Disha, feel free to add:
> 
> Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
> 
> One small comment:
>> ---
>>   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
> 
> I think this comment is not needed as _notrun explains it already

Thanks, I'll fix this in v2.

> 
>> +    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
>>

-- 
Regards,
Disha


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-06-03 14:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-02 10:14 [PATCH] common/defrag: Skip defrag tests on DAX-enabled filesystems Disha Goel
2026-06-02 10:38 ` Ojaswin Mujoo
2026-06-03 14:22   ` Disha Goel
2026-06-02 20:09 ` Darrick J. Wong
2026-06-03 14:20   ` Disha Goel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox