[PATCH 7/8] common/attr: fix _require_noattr2

Darrick J. Wong
2025-10-15T16:38:33Z

From: Darrick J. Wong <djwong@kernel.org>

attr2/noattr2 doesn't do anything anymore and aren't reported in
/proc/mounts, so we need to check /proc/mounts and _notrun as a result.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
common/attr | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/common/attr b/common/attr
index 1c1de63e9d5465..35e0bee4e3aa53 100644
--- a/common/attr
+++ b/common/attr
@@ -241,7 +241,11 @@ _require_noattr2()
|| _fail "_try_scratch_mkfs_xfs failed on $SCRATCH_DEV"
_try_scratch_mount -o noattr2 > /dev/null 2>&1 \
|| _notrun "noattr2 mount option not supported on $SCRATCH_DEV"
+ grep -w "$SCRATCH_MNT" /proc/mounts | awk '{print $4}' | grep -q -w noattr2
+ local res=${PIPESTATUS[2]}
_scratch_unmount
+ test $res -eq 0 \
+ || _notrun "noattr2 mount option no longer functional"
}

# getfattr -R returns info in readdir order which varies from fs to fs.