]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
xfs/{018,191,288}: disable parent pointers for these tests
authorDarrick J. Wong <djwong@kernel.org>
Thu, 20 Jun 2024 20:58:29 +0000 (13:58 -0700)
committerZorro Lang <zlang@kernel.org>
Sun, 23 Jun 2024 15:04:36 +0000 (23:04 +0800)
These tests depend heavily on the xattr formats created for new files.
Parent pointers break those assumptions, so force parent pointers off.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/xfs
tests/xfs/018
tests/xfs/191
tests/xfs/288

index 0b0863f1dc83922b65647f1c41b109c1186051e2..b392237575381de78133daeadd20544ce37b0bc5 100644 (file)
@@ -1847,3 +1847,19 @@ _require_xfs_nocrc()
                _notrun "v4 file systems not supported"
        _scratch_unmount
 }
+
+# Adjust MKFS_OPTIONS as necessary to avoid having parent pointers formatted
+# onto the filesystem
+_xfs_force_no_pptrs()
+{
+       # Nothing to do if parent pointers aren't supported by mkfs
+       $MKFS_XFS_PROG 2>&1 | grep -q parent=0 || return
+
+       if echo "$MKFS_OPTIONS" | grep -q 'parent='; then
+               MKFS_OPTIONS="$(echo "$MKFS_OPTIONS" | \
+                               sed -e 's/parent=[01]/parent=0/g')"
+               return
+       fi
+
+       MKFS_OPTIONS="$MKFS_OPTIONS -n parent=0"
+}
index 73040edc926617985a4c7d641a9d0708d0d7df89..7d1b861d1caba14ab3a728b1ba78c924489eb53b 100755 (executable)
@@ -111,6 +111,10 @@ attr32l="X$attr32k"
 attr64k="$attr32k$attr32k"
 
 echo "*** mkfs"
+
+# Parent pointers change the xattr formats sufficiently to break this test.
+# Disable parent pointers if mkfs supports it.
+_xfs_force_no_pptrs
 _scratch_mkfs >/dev/null
 
 blk_sz=$(_scratch_xfs_get_sb_field blocksize)
index 7a02f1be217cb8442e0cf78b5b40e78fca7605dd..e2150bf797d1f9c738e06e6cf6dc4cb6939c8a46 100755 (executable)
@@ -33,6 +33,9 @@ _fixed_by_kernel_commit 7be3bd8856fb "xfs: empty xattr leaf header blocks are no
 _fixed_by_kernel_commit e87021a2bc10 "xfs: use larger in-core attr firstused field and detect overflow"
 _fixed_by_git_commit xfsprogs f50d3462c654 "xfs_repair: ignore empty xattr leaf blocks"
 
+# Parent pointers change the xattr formats sufficiently to break this test.
+# Disable parent pointers if mkfs supports it.
+_xfs_force_no_pptrs
 _scratch_mkfs_xfs | _filter_mkfs >$seqres.full 2>$tmp.mkfs
 cat $tmp.mkfs >> $seqres.full
 source $tmp.mkfs
index aa664a266e5d36ff3384c083f68d97a8da0b2a84..60fb9360f40a05c362f7c9d27a1fe8b63aa1d08e 100755 (executable)
@@ -19,6 +19,10 @@ _supported_fs xfs
 _require_scratch
 _require_attrs
 
+# Parent pointers change the xattr formats sufficiently to break this test.
+# Disable parent pointers if mkfs supports it.
+_xfs_force_no_pptrs
+
 # get block size ($dbsize) from the mkfs output
 _scratch_mkfs_xfs 2>/dev/null | _filter_mkfs 2>$tmp.mkfs >/dev/null
 . $tmp.mkfs