xfs/157: do not drop necessary mkfs options
authorZorro Lang <zlang@kernel.org>
Tue, 26 Nov 2024 01:23:56 +0000 (17:23 -0800)
committerZorro Lang <zlang@kernel.org>
Thu, 28 Nov 2024 13:39:49 +0000 (21:39 +0800)
To give the test option "-L oldlabel" to _scratch_mkfs_sized, xfs/157
does:

  MKFS_OPTIONS="-L oldlabel $MKFS_OPTIONS" _scratch_mkfs_sized $fs_size

but the _scratch_mkfs_sized trys to keep the $fs_size, when mkfs
fails with incompatible $MKFS_OPTIONS options, likes this:

  ** mkfs failed with extra mkfs options added to "-L oldlabel -m rmapbt=1" by test 157 **
  ** attempting to mkfs using only test 157 options: -d size=524288000 -b size=4096 **

but the "-L oldlabel" is necessary, we shouldn't drop it. To avoid
that, we give the "-L oldlabel" to _scratch_mkfs_sized through
function parameters, not through global MKFS_OPTIONS.

Reviewed-by: Darrick J. Wong <djwong@kernel.org>
[djwong: fix more string quoting issues]
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/xfs/157

index 9b5badbaeb3c765fc7659b9659eaa4d6cdcd5d1f..e102a5a10abe4b556bc0eaa11ca1f6c2a0c96ea0 100755 (executable)
@@ -66,8 +66,7 @@ scenario() {
 }
 
 check_label() {
-       MKFS_OPTIONS="-L oldlabel $MKFS_OPTIONS" _scratch_mkfs_sized $fs_size \
-               >> $seqres.full
+       _scratch_mkfs_sized "$fs_size" "" -L oldlabel >> $seqres.full 2>&1
        _scratch_xfs_db -c label
        _scratch_xfs_admin -L newlabel "$@" >> $seqres.full
        _scratch_xfs_db -c label