Re: [PATCH v5 10/10] scsi: scsi_debug: Add param to control sdev's allow_restart

From: Douglas Gilbert
Date: Sun Oct 08 2023 - 19:17:17 EST


On 2023-09-22 05:29, Wenchao Hao wrote:
Add new module param "allow_restart" to control if setup
scsi_device's allow_restart flag. This is used to test scsi
command finished with sense_key 0x6, asc 0x4 and ascq 0x2

Signed-off-by: Wenchao Hao <haowenchao2@xxxxxxxxxx>

Hi,
Looked at this and verified that the allow_restart flag of scsi_debug
devices (disks ?) is usually 0 and when the scsi_debug module is
started with allow_restart=1 then the allow_restart flag does indeed
change to 1. For example:
# cat /sys/class/scsi_disk/1\:0\:0\:0/allow_restart
1

That ASC/ASCQ code means: "Logical unit not ready, initializing command
required" according to my library. Played around with sg_start but didn't
see any change in how it reacts. According to scsi_device.h that flag's
description is: "issue START_UNIT in error handler" which implies it
changes how the EH handler reacts.

Perhaps the 3 line patch description could say a little more about how
to use this new parameter...

Tested-by: Douglas Gilbert <dgilbert@xxxxxxxxxxxx>

<snip>