]> www.infradead.org Git - users/hch/blktests.git/commitdiff
common/scsi_debug: prepare scsi_debug in zoned mode
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Wed, 30 Mar 2022 01:32:11 +0000 (10:32 +0900)
committerOmar Sandoval <osandov@fb.com>
Mon, 9 May 2022 19:11:16 +0000 (12:11 -0700)
To allow running tests using scsi_debug device with the zoned mode
disabled (current setup) as well as enabled, modify the _init_scsi_debug
helper function. When RUN_FOR_ZONED is set, specify zbc=host-managed
parameter to scsi_debug module so that the scsi_debug devices are
prepared in zoned mode.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
common/scsi_debug

index b48cdc9e2b4da42854e3e5de4419e56396765c48..95da14ec471a48072f5fbb0e196074cc7beb06ae 100644 (file)
@@ -9,7 +9,16 @@ _have_scsi_debug() {
 }
 
 _init_scsi_debug() {
-       if ! modprobe -r scsi_debug || ! modprobe scsi_debug "$@"; then
+       local -a args=("$@")
+
+       if (( RUN_FOR_ZONED )); then
+               if ! _have_module_param scsi_debug zbc; then
+                       return
+               fi
+               args+=(zbc=host-managed zone_nr_conv=0)
+       fi
+
+       if ! modprobe -r scsi_debug || ! modprobe scsi_debug "${args[@]}"; then
                return 1
        fi