Skip to contentSkip to conversation

_test_mkfs: Include external log device (if any) when creating fs on TEST_DEV

PATCH In review Chandan Babu R 3 participants 3 messages May 24, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 _test_mkfs: Include external log device (if any) when creating fs on TEST_DEV

Test execution fails when testing XFS with external log device and when RECREATE_TEST_DEV is set to true. This is because _test_mkfs() is invoked as part of recreating the filesystem on test device and this function does not include the external log device as part of the mkfs.xfs command line.

_test_mount() invoked later fails since it passes an external log device to the mount syscall which the kernel does not expect to find.

To fix this bug, this commit modifies _test_mkfs() to invoke _test_options() in order to compute the value of TEST_OPTIONS and includes the resulting value in the mkfs.xfs command line.

---
 common/rc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
common/rc +2 -1
index 0fe56382..6562ccd7 100644
@@ -614,7 +614,8 @@ _test_mkfs()
 	$MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $* $TEST_DEV
 	;;
     xfs)
-	$MKFS_PROG -t $FSTYP -- -f $MKFS_OPTIONS $* $TEST_DEV
+	_test_options mkfs
+	$MKFS_PROG -t $FSTYP -- -f $TEST_OPTIONS $MKFS_OPTIONS $* $TEST_DEV
 	;;
     bcachefs)
 	$MKFS_BCACHEFS_PROG $MKFS_OPTIONS $* $TEST_DEV > /dev/null
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#2 lore raw
In reply to Chandan Babu R
Quoted 5 lines · Chandan Babu R

Test execution fails when testing XFS with external log device and when RECREATE_TEST_DEV is set to true. This is because _test_mkfs() is invoked as part of recreating the filesystem on test device and this function does not include the external log device as part of the mkfs.xfs command line.

Quoted 8 lines

_test_mount() invoked later fails since it passes an external log device to the mount syscall which the kernel does not expect to find.

To fix this bug, this commit modifies _test_mkfs() to invoke _test_options() in order to compute the value of TEST_OPTIONS and includes the resulting value in the mkfs.xfs command line.

Doh

--D

Quoted 22 lines
---
 common/rc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
common/rc +2 -1
index 0fe56382..6562ccd7 100644
@@ -614,7 +614,8 @@ _test_mkfs()
 	$MKFS_PROG -t $FSTYP -- -F $MKFS_OPTIONS $* $TEST_DEV
 	;;
     xfs)
-	$MKFS_PROG -t $FSTYP -- -f $MKFS_OPTIONS $* $TEST_DEV
+	_test_options mkfs
+	$MKFS_PROG -t $FSTYP -- -f $TEST_OPTIONS $MKFS_OPTIONS $* $TEST_DEV
 	;;
     bcachefs)
 	$MKFS_BCACHEFS_PROG $MKFS_OPTIONS $* $TEST_DEV > /dev/null
Signature · 1 line
2.43.0