Linux XFS filesystem development
 help / color / mirror / Atom feed
* [PATCH] generic/{349,350,351}: fix scsi_debug parameter quoting issues
@ 2026-09-24  6:03 Darrick J. Wong
  2026-09-24 11:36 ` Andrey Albershteyn
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Darrick J. Wong @ 2026-09-24  6:03 UTC (permalink / raw)
  To: Zorro Lang; +Cc: fstests, xfs

From: Darrick J. Wong <djwong@kernel.org>

Commit a90ba59dca447d reworked the argument handling code inside
_get_scsi_debug_dev to put all the remaining arguments (after we extract
the first four arguments) inside an array that gets passed to modprobe:

	opts+=("$@")

This code takes every command line argument and copies them into the
array verbatim.  Contrast this to what it did before (excerpted):

	opts="...dev_size_mb=$size $@"
	echo "scsi_debug options $opts" >> $seqres.full
	modprobe scsi_debug $opts

The old code put all the arguments into a string, then passed the string
unquoted to modprobe, which means that any spaces in the parameters
given to _get_scsi_debug_dev become argument separators in the modprobe
call.  Put more simply, passing "foo=1 bar=1" to _get_scsi_debug_dev
results in "foo=1" "bar=1" being passed to modprobe.

Now we no longer do that, which causes these three tests to fail with:

	scsi_debug: `1 lbpws10=1' invalid for parameter `lbpws'

because we're effectively passing lbpws="1 lbpws10=1" to scsi_debug.
Fix this by removing the quoting from the three tests.

Cc: <fstests@vger.kernel.org> # v2026.09.22
Fixes: a90ba59dca447d ("common/scsi_debug: don't slow down I/O")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
 tests/generic/349 |    2 +-
 tests/generic/350 |    2 +-
 tests/generic/351 |    4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/generic/349 b/tests/generic/349
index 72fbda412ea41c..0d019d4ab46170 100755
--- a/tests/generic/349
+++ b/tests/generic/349
@@ -20,7 +20,7 @@ _require_scsi_debug
 _require_xfs_io_command "fzero"
 
 echo "Create and format"
-dev=$(_get_scsi_debug_dev 512 512 0 4 "lbpws=1 lbpws10=1")
+dev=$(_get_scsi_debug_dev 512 512 0 4 lbpws=1 lbpws10=1)
 _pwrite_byte 0x62 0 4m $dev >> $seqres.full
 
 echo "Zero range"
diff --git a/tests/generic/350 b/tests/generic/350
index 6079a8d5032303..7dcdda03a613ff 100755
--- a/tests/generic/350
+++ b/tests/generic/350
@@ -20,7 +20,7 @@ _require_scsi_debug
 _require_xfs_io_command "fpunch"
 
 echo "Create and format"
-dev=$(_get_scsi_debug_dev 512 512 0 4 "lbpws=1 lbpws10=1")
+dev=$(_get_scsi_debug_dev 512 512 0 4 lbpws=1 lbpws10=1)
 _pwrite_byte 0x62 0 4m $dev >> $seqres.full
 
 echo "Zero punch"
diff --git a/tests/generic/351 b/tests/generic/351
index e73b70e4d7957e..374ea1afe46d76 100755
--- a/tests/generic/351
+++ b/tests/generic/351
@@ -27,7 +27,7 @@ _require_xfs_io_command "fzero"
 _require_xfs_io_command "fpunch"
 
 echo "Create and format"
-dev=$(_get_scsi_debug_dev 4096 4096 0 4 "lbpws=1 lbpws10=1")
+dev=$(_get_scsi_debug_dev 4096 4096 0 4 lbpws=1 lbpws10=1)
 _pwrite_byte 0x62 0 4m $dev >> $seqres.full
 $XFS_IO_PROG -c "fsync" $dev
 
@@ -70,7 +70,7 @@ echo "Destroy device"
 _put_scsi_debug_dev
 
 echo "Create w/o unmap or writesame and format"
-dev=$(_get_scsi_debug_dev 512 512 0 4 "lbpws=0 lbpws10=0 lbpu=0 write_same_length=0 unmap_max_blocks=0")
+dev=$(_get_scsi_debug_dev 512 512 0 4 lbpws=0 lbpws10=0 lbpu=0 write_same_length=0 unmap_max_blocks=0)
 _pwrite_byte 0x62 0 4m $dev >> $seqres.full
 $XFS_IO_PROG -c "fsync" $dev
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] generic/{349,350,351}: fix scsi_debug parameter quoting issues
  2026-09-24  6:03 [PATCH] generic/{349,350,351}: fix scsi_debug parameter quoting issues Darrick J. Wong
@ 2026-09-24 11:36 ` Andrey Albershteyn
  2026-09-25  5:01 ` Christoph Hellwig
  2026-09-28 13:55 ` Zorro Lang
  2 siblings, 0 replies; 4+ messages in thread
From: Andrey Albershteyn @ 2026-09-24 11:36 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Zorro Lang, fstests, xfs

On 2026-09-23 23:03:15, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Commit a90ba59dca447d reworked the argument handling code inside
> _get_scsi_debug_dev to put all the remaining arguments (after we extract
> the first four arguments) inside an array that gets passed to modprobe:
> 
> 	opts+=("$@")
> 
> This code takes every command line argument and copies them into the
> array verbatim.  Contrast this to what it did before (excerpted):
> 
> 	opts="...dev_size_mb=$size $@"
> 	echo "scsi_debug options $opts" >> $seqres.full
> 	modprobe scsi_debug $opts
> 
> The old code put all the arguments into a string, then passed the string
> unquoted to modprobe, which means that any spaces in the parameters
> given to _get_scsi_debug_dev become argument separators in the modprobe
> call.  Put more simply, passing "foo=1 bar=1" to _get_scsi_debug_dev
> results in "foo=1" "bar=1" being passed to modprobe.
> 
> Now we no longer do that, which causes these three tests to fail with:
> 
> 	scsi_debug: `1 lbpws10=1' invalid for parameter `lbpws'
> 
> because we're effectively passing lbpws="1 lbpws10=1" to scsi_debug.
> Fix this by removing the quoting from the three tests.
> 
> Cc: <fstests@vger.kernel.org> # v2026.09.22
> Fixes: a90ba59dca447d ("common/scsi_debug: don't slow down I/O")
> Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>

Looks good to me
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>

-- 
- Andrey

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] generic/{349,350,351}: fix scsi_debug parameter quoting issues
  2026-09-24  6:03 [PATCH] generic/{349,350,351}: fix scsi_debug parameter quoting issues Darrick J. Wong
  2026-09-24 11:36 ` Andrey Albershteyn
@ 2026-09-25  5:01 ` Christoph Hellwig
  2026-09-28 13:55 ` Zorro Lang
  2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2026-09-25  5:01 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Zorro Lang, fstests, xfs

On Wed, Sep 23, 2026 at 11:03:15PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Commit a90ba59dca447d reworked the argument handling code inside
> _get_scsi_debug_dev to put all the remaining arguments (after we extract
> the first four arguments) inside an array that gets passed to modprobe:
> 
> 	opts+=("$@")
> 
> This code takes every command line argument and copies them into the
> array verbatim.  Contrast this to what it did before (excerpted):

Arrg, that's what I get from following good suggestions on shell
style..

The fix looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] generic/{349,350,351}: fix scsi_debug parameter quoting issues
  2026-09-24  6:03 [PATCH] generic/{349,350,351}: fix scsi_debug parameter quoting issues Darrick J. Wong
  2026-09-24 11:36 ` Andrey Albershteyn
  2026-09-25  5:01 ` Christoph Hellwig
@ 2026-09-28 13:55 ` Zorro Lang
  2 siblings, 0 replies; 4+ messages in thread
From: Zorro Lang @ 2026-09-28 13:55 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: fstests, xfs

On Wed, Sep 23, 2026 at 11:03:15PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Commit a90ba59dca447d reworked the argument handling code inside
> _get_scsi_debug_dev to put all the remaining arguments (after we extract
> the first four arguments) inside an array that gets passed to modprobe:
> 
> 	opts+=("$@")
> 
> This code takes every command line argument and copies them into the
> array verbatim.  Contrast this to what it did before (excerpted):
> 
> 	opts="...dev_size_mb=$size $@"
> 	echo "scsi_debug options $opts" >> $seqres.full
> 	modprobe scsi_debug $opts
> 
> The old code put all the arguments into a string, then passed the string
> unquoted to modprobe, which means that any spaces in the parameters
> given to _get_scsi_debug_dev become argument separators in the modprobe
> call.  Put more simply, passing "foo=1 bar=1" to _get_scsi_debug_dev
> results in "foo=1" "bar=1" being passed to modprobe.
> 
> Now we no longer do that, which causes these three tests to fail with:
> 
> 	scsi_debug: `1 lbpws10=1' invalid for parameter `lbpws'
> 
> because we're effectively passing lbpws="1 lbpws10=1" to scsi_debug.
> Fix this by removing the quoting from the three tests.
> 
> Cc: <fstests@vger.kernel.org> # v2026.09.22
> Fixes: a90ba59dca447d ("common/scsi_debug: don't slow down I/O")
> Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
> ---

Thanks for finding and fixing it.

Reviewed-by: Zorro Lang <zlang@kernel.org>

>  tests/generic/349 |    2 +-
>  tests/generic/350 |    2 +-
>  tests/generic/351 |    4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/generic/349 b/tests/generic/349
> index 72fbda412ea41c..0d019d4ab46170 100755
> --- a/tests/generic/349
> +++ b/tests/generic/349
> @@ -20,7 +20,7 @@ _require_scsi_debug
>  _require_xfs_io_command "fzero"
>  
>  echo "Create and format"
> -dev=$(_get_scsi_debug_dev 512 512 0 4 "lbpws=1 lbpws10=1")
> +dev=$(_get_scsi_debug_dev 512 512 0 4 lbpws=1 lbpws10=1)
>  _pwrite_byte 0x62 0 4m $dev >> $seqres.full
>  
>  echo "Zero range"
> diff --git a/tests/generic/350 b/tests/generic/350
> index 6079a8d5032303..7dcdda03a613ff 100755
> --- a/tests/generic/350
> +++ b/tests/generic/350
> @@ -20,7 +20,7 @@ _require_scsi_debug
>  _require_xfs_io_command "fpunch"
>  
>  echo "Create and format"
> -dev=$(_get_scsi_debug_dev 512 512 0 4 "lbpws=1 lbpws10=1")
> +dev=$(_get_scsi_debug_dev 512 512 0 4 lbpws=1 lbpws10=1)
>  _pwrite_byte 0x62 0 4m $dev >> $seqres.full
>  
>  echo "Zero punch"
> diff --git a/tests/generic/351 b/tests/generic/351
> index e73b70e4d7957e..374ea1afe46d76 100755
> --- a/tests/generic/351
> +++ b/tests/generic/351
> @@ -27,7 +27,7 @@ _require_xfs_io_command "fzero"
>  _require_xfs_io_command "fpunch"
>  
>  echo "Create and format"
> -dev=$(_get_scsi_debug_dev 4096 4096 0 4 "lbpws=1 lbpws10=1")
> +dev=$(_get_scsi_debug_dev 4096 4096 0 4 lbpws=1 lbpws10=1)
>  _pwrite_byte 0x62 0 4m $dev >> $seqres.full
>  $XFS_IO_PROG -c "fsync" $dev
>  
> @@ -70,7 +70,7 @@ echo "Destroy device"
>  _put_scsi_debug_dev
>  
>  echo "Create w/o unmap or writesame and format"
> -dev=$(_get_scsi_debug_dev 512 512 0 4 "lbpws=0 lbpws10=0 lbpu=0 write_same_length=0 unmap_max_blocks=0")
> +dev=$(_get_scsi_debug_dev 512 512 0 4 lbpws=0 lbpws10=0 lbpu=0 write_same_length=0 unmap_max_blocks=0)
>  _pwrite_byte 0x62 0 4m $dev >> $seqres.full
>  $XFS_IO_PROG -c "fsync" $dev
>  

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-28 13:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-24  6:03 [PATCH] generic/{349,350,351}: fix scsi_debug parameter quoting issues Darrick J. Wong
2026-09-24 11:36 ` Andrey Albershteyn
2026-09-25  5:01 ` Christoph Hellwig
2026-09-28 13:55 ` Zorro Lang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox