Skip to contentSkip to conversation

xfs/837: set rtinherit on the root directory programmatically

PATCH In review Darrick J. Wong 3 participants 4 messages Aug 26 – Aug 28

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs/837: set rtinherit on the root directory programmatically

From: Darrick J. Wong <[email protected]>

I patched mkfs to enable metadir by default, but then this test regressed on the "-m metadir=0 -d rtinherit=1..." configuration. Upon digging into the test results, I observed that the scratch filesystem actually had metadir enabled despite the intended configuration. That in turn revealed that _scratch_mkfs was failing because -d rtinherit was being respecified, so it did that obnoxious thing it does and reformats with only the caller's mkfs options.

As a result, the scratch filesystem is configured incorrectly -- metadir is enabled when we don't want it to be, so we pick the wrong output file and fail.

Instead of passing -drtinherit and potentially conflicting with the test configuration options, let's use _xfs_force_bdev to set rtinherit programmatically.

Cc <[email protected]> # v2025.06.22
Fixes e225772353e212 ("xfs: add mount test for read only rt devices")
---
 tests/xfs/837 |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tests/xfs/837 +5 -1
index 2fe195a009f10f..33ec37ae3dbde3 100755
@@ -35,7 +35,11 @@ fi
 
 _register_cleanup "_cleanup_setrw"
 
-_scratch_mkfs "-d rtinherit" > /dev/null 2>&1
+_scratch_mkfs > /dev/null 2>&1
+
+_scratch_mount
+_xfs_force_bdev realtime $SCRATCH_MNT
+_scratch_unmount
 
 # Select appropriate output file
 features=""
Reviewed-by on v1 1/1
#2 lore raw
In reply to Darrick J. Wong
Quoted 18 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

I patched mkfs to enable metadir by default, but then this test regressed on the "-m metadir=0 -d rtinherit=1..." configuration. Upon digging into the test results, I observed that the scratch filesystem actually had metadir enabled despite the intended configuration. That in turn revealed that _scratch_mkfs was failing because -d rtinherit was being respecified, so it did that obnoxious thing it does and reformats with only the caller's mkfs options.

As a result, the scratch filesystem is configured incorrectly -- metadir is enabled when we don't want it to be, so we pick the wrong output file and fail.

Instead of passing -drtinherit and potentially conflicting with the test configuration options, let's use _xfs_force_bdev to set rtinherit programmatically.

Quoted 5 lines
Cc <[email protected]> # v2025.06.22
Fixes e225772353e212 ("xfs: add mount test for read only rt devices")

---

Makes sense to me,

Quoted 20 lines
 tests/xfs/837 |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tests/xfs/837 +5 -1
index 2fe195a009f10f..33ec37ae3dbde3 100755
@@ -35,7 +35,11 @@ fi
 
 _register_cleanup "_cleanup_setrw"
 
-_scratch_mkfs "-d rtinherit" > /dev/null 2>&1
+_scratch_mkfs > /dev/null 2>&1
+
+_scratch_mount
+_xfs_force_bdev realtime $SCRATCH_MNT
+_scratch_unmount
 
 # Select appropriate output file
 features=""
Reviewed-by on v1 1/1
#3 lore raw
In reply to Darrick J. Wong
Quoted 34 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

I patched mkfs to enable metadir by default, but then this test regressed on the "-m metadir=0 -d rtinherit=1..." configuration. Upon digging into the test results, I observed that the scratch filesystem actually had metadir enabled despite the intended configuration. That in turn revealed that _scratch_mkfs was failing because -d rtinherit was being respecified, so it did that obnoxious thing it does and reformats with only the caller's mkfs options.

As a result, the scratch filesystem is configured incorrectly -- metadir is enabled when we don't want it to be, so we pick the wrong output file and fail.

Instead of passing -drtinherit and potentially conflicting with the test configuration options, let's use _xfs_force_bdev to set rtinherit programmatically.

Cc <[email protected]> # v2025.06.22
Fixes e225772353e212 ("xfs: add mount test for read only rt devices")
---
 tests/xfs/837 |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tests/xfs/837 +0 -0
index 2fe195a009f10f..33ec37ae3dbde3 100755
@@ -35,7 +35,11 @@ fi
 
 _register_cleanup "_cleanup_setrw"

tests/xfs/837 fi · line 45

Quoted 10 lines
tests/xfs/837 +5 -1
 
-_scratch_mkfs "-d rtinherit" > /dev/null 2>&1
+_scratch_mkfs > /dev/null 2>&1
+
+_scratch_mount
+_xfs_force_bdev realtime $SCRATCH_MNT
+_scratch_unmount
 
 # Select appropriate output file
 features=""

Looks good to me!