]> git.ipfire.org Git - thirdparty/qemu.git/commit
scsi: megasas: Internal cdbs have 16-byte length
authorGuenter Roeck <linux@roeck-us.net>
Tue, 28 Feb 2023 17:11:29 +0000 (09:11 -0800)
committerMichael Tokarev <mjt@tls.msk.ru>
Mon, 16 Dec 2024 12:27:45 +0000 (15:27 +0300)
commitc6c7093da0480c8fbfc05d520f279af22fe67977
tree8fb4eb72b44d9b61531a3bb1286288b8cc1ca85f
parent6d52a53e7bd886e7852a6be9694901a23752c88f
scsi: megasas: Internal cdbs have 16-byte length

Host drivers do not necessarily set cdb_len in megasas io commands.
With commits 6d1511cea0 ("scsi: Reject commands if the CDB length
exceeds buf_len") and fe9d8927e2 ("scsi: Add buf_len parameter to
scsi_req_new()"), this results in failures to boot Linux from affected
SCSI drives because cdb_len is set to 0 by the host driver.
Set the cdb length to its actual size to solve the problem.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.kernel.org/r/20230228171129.4094709-1-linux@roeck-us.net
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 3abb67323aeecf06a27191076ab50424ec21f334)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/scsi/megasas.c