Skip to content

scsi: specify .sense_len = SCSI_SENSE_BUFFERSIZE in scsi_execute() scsi_exec_args

Ewan D. Milne requested to merge e-milne/centos-stream-9:RHEL-30596 into main

JIRA: https://issues.redhat.com/browse/RHEL-30596 Upstream Status: RHEL only

Upstream commit d0949565811f ("scsi: core: Add struct for args to execution functions") was the initial step in converting all callers of __scsi_execute() to scsi_execute_cmd(). A later commit removed __scsi_execute() after all drivers were converted. Unfortunately, 3rd party drivers are still using the __scsi_execute() API, and it no longer works, because the .sense_len was not set and scsi_execute_cmd() will then always return -EINVAL. Fix this by specifying .sense_len so 3rd party drivers will work with RHEL 9.

Note: the previous kernel code contained a BUILD_BUG_ON() to check the sizeof() the sense buffer, but this is not possible here because __scsi_execute() does not have the size information.

Fixes: b7ca7e04 ("scsi: core: Add struct for args to execution functions") Signed-off-by: Ewan D. Milne emilne@redhat.com

Merge request reports