diff options
author | Chaohai Chen <wdhh66@163.com> | 2025-01-15 15:07:39 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-04-20 10:15:17 +0200 |
commit | 93a562eedcd5da087e30d7e35374fe2bad38f88e (patch) | |
tree | dbc082163c0ab18b064dacba092f35f9255df823 | |
parent | 4ae2c7c7d36976b381352b34eab6bf501afe0f1a (diff) |
scsi: target: spc: Fix RSOC parameter data header size
[ Upstream commit b50532318793d28a7628c1ffc129a2226e83e495 ]
The SPC document states that "The COMMAND DATA LENGTH field indicates the
length in bytes of the command descriptor list".
The length should be subtracted by 4 to represent the length of the
description list, not 3.
Signed-off-by: Chaohai Chen <wdhh66@163.com>
Link: https://lore.kernel.org/r/20250115070739.216154-1-wdhh66@163.com
Reviewed-by: Dmitry Bogdanov <d.bogdanov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/target/target_core_spc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c index ea14a3835681..61c065702350 100644 --- a/drivers/target/target_core_spc.c +++ b/drivers/target/target_core_spc.c @@ -2243,7 +2243,7 @@ spc_emulate_report_supp_op_codes(struct se_cmd *cmd) response_length += spc_rsoc_encode_command_descriptor( &buf[response_length], rctd, descr); } - put_unaligned_be32(response_length - 3, buf); + put_unaligned_be32(response_length - 4, buf); } else { response_length = spc_rsoc_encode_one_command_descriptor( &buf[response_length], rctd, descr, |