Skip to contentSkip to conversation

fstests: Disable realtime inherit flag when executing xfs/{532,533,538}

PATCH In review Chandan Babu R 2 participants 2 messages Apr 9, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fstests: Disable realtime inherit flag when executing xfs/{532,533,538}

The minimum length space allocator (i.e. xfs_bmap_exact_minlen_extent_alloc()) depends on the underlying filesystem to be fragmented so that there are enough one block sized extents available to satify space allocation requests.

xfs/{532,533,538} tests issue space allocation requests for metadata (e.g. for blocks holding directory and xattr information). With realtime filesystem instances, these tests would end up fragmenting the space on realtime device. Hence minimum length space allocator fails since the regular filesystem space is not fragmented and hence there are no one block sized extents available.

Thus, this commit disables realtime inherit flag (if any) on root directory so that space on data device gets fragmented rather than realtime device.

---
 tests/xfs/532 | 4 ++++
 tests/xfs/533 | 4 ++++
 tests/xfs/538 | 4 ++++
 3 files changed, 12 insertions(+)
tests/xfs/532 +4 -0
index 2bed574a..560af586 100755
@@ -45,6 +45,10 @@ echo "Format and mount fs"
 _scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full
 _scratch_mount >> $seqres.full
 
+# Disable realtime inherit flag (if any) on root directory so that space on data
+# device gets fragmented rather than realtime device.
+$XFS_IO_PROG -c 'chattr -t' $SCRATCH_MNT
+
 bsize=$(_get_block_size $SCRATCH_MNT)
 
 attr_len=255
tests/xfs/533 +4 -0
index be909fcc..dd4cb4c4 100755
@@ -56,6 +56,10 @@ echo "Format and mount fs"
 _scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full
 _scratch_mount >> $seqres.full
 
+# Disable realtime inherit flag (if any) on root directory so that space on data
+# device gets fragmented rather than realtime device.
+$XFS_IO_PROG -c 'chattr -t' $SCRATCH_MNT
+
 echo "Consume free space"
 fillerdir=$SCRATCH_MNT/fillerdir
 nr_free_blks=$(stat -f -c '%f' $SCRATCH_MNT)
tests/xfs/538 +4 -0
index 90eb1637..97273b88 100755
@@ -42,6 +42,10 @@ echo "Format and mount fs"
 _scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full
 _scratch_mount >> $seqres.full
 
+# Disable realtime inherit flag (if any) on root directory so that space on data
+# device gets fragmented rather than realtime device.
+$XFS_IO_PROG -c 'chattr -t' $SCRATCH_MNT
+
 bsize=$(_get_file_block_size $SCRATCH_MNT)
 
 echo "Consume free space"
Signature · 1 line
2.29.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Chandan Babu R

The minimum length space allocator (i.e. xfs_bmap_exact_minlen_extent_alloc()) depends on the underlying filesystem to be fragmented so that there are enough one block sized extents available to satify space allocation requests.

xfs/{532,533,538} tests issue space allocation requests for metadata (e.g. for blocks holding directory and xattr information). With realtime filesystem instances, these tests would end up fragmenting the space on realtime device. Hence minimum length space allocator fails since the regular filesystem space is not fragmented and hence there are no one block sized extents available.

Quoted 6 lines

Thus, this commit disables realtime inherit flag (if any) on root directory so that space on data device gets fragmented rather than realtime device.

Looks good to me,

--D

Quoted 54 lines
---
 tests/xfs/532 | 4 ++++
 tests/xfs/533 | 4 ++++
 tests/xfs/538 | 4 ++++
 3 files changed, 12 insertions(+)
tests/xfs/532 +4 -0
index 2bed574a..560af586 100755
@@ -45,6 +45,10 @@ echo "Format and mount fs"
 _scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full
 _scratch_mount >> $seqres.full
 
+# Disable realtime inherit flag (if any) on root directory so that space on data
+# device gets fragmented rather than realtime device.
+$XFS_IO_PROG -c 'chattr -t' $SCRATCH_MNT
+
 bsize=$(_get_block_size $SCRATCH_MNT)
 
 attr_len=255
tests/xfs/533 +4 -0
index be909fcc..dd4cb4c4 100755
@@ -56,6 +56,10 @@ echo "Format and mount fs"
 _scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full
 _scratch_mount >> $seqres.full
 
+# Disable realtime inherit flag (if any) on root directory so that space on data
+# device gets fragmented rather than realtime device.
+$XFS_IO_PROG -c 'chattr -t' $SCRATCH_MNT
+
 echo "Consume free space"
 fillerdir=$SCRATCH_MNT/fillerdir
 nr_free_blks=$(stat -f -c '%f' $SCRATCH_MNT)
tests/xfs/538 +4 -0
index 90eb1637..97273b88 100755
@@ -42,6 +42,10 @@ echo "Format and mount fs"
 _scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full
 _scratch_mount >> $seqres.full
 
+# Disable realtime inherit flag (if any) on root directory so that space on data
+# device gets fragmented rather than realtime device.
+$XFS_IO_PROG -c 'chattr -t' $SCRATCH_MNT
+
 bsize=$(_get_file_block_size $SCRATCH_MNT)
 
 echo "Consume free space"
Signature · 1 line
2.29.2