[PATCH 13/33] defrag: fix ext4 defrag ioctl test

Darrick J. Wong
2025-10-29T01:23:49Z

ioctl() can return ENOTTY if the ioctl number isn't recognized at all.
Change _require_defrag to _notrun the test if the ext4 defrag ioctl
isn't recognised at all.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
common/defrag | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/defrag b/common/defrag
index c054e62bde6f4d..43ec07ddd4ac2a 100644
--- a/common/defrag
+++ b/common/defrag
@@ -19,7 +19,7 @@ _require_defrag()
$XFS_IO_PROG -f -c "pwrite -b $bsize 0 $bsize" $testfile > /dev/null
cp $testfile $donorfile
echo $testfile | $here/src/e4compact -v -f $donorfile | \
- grep -q "err:95"
+ grep -q -E "err:(95|25)"
if [ $? -eq 0 ]; then
rm -f $testfile $donorfile 2>&1 > /dev/null
_notrun "$FSTYP test filesystem doesn't support online defrag"