From: Dmitry Bogdanov <d.bogdanov@yadro.com>
To: Chaohai Chen <wdhh66@163.com>
Cc: <martin.petersen@oracle.com>, <linux-scsi@vger.kernel.org>,
<target-devel@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] target: fix All_commands parameter data header size
Date: Wed, 15 Jan 2025 10:36:08 +0300 [thread overview]
Message-ID: <20250115073608.GA17942@yadro.com> (raw)
In-Reply-To: <20250115070739.216154-1-wdhh66@163.com>
On Wed, Jan 15, 2025 at 03:07:39PM +0800, Chaohai Chen wrote:
> 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>
> ---
> drivers/target/target_core_spc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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,
> --
> 2.34.1
>
Reviewed-by: Dmitry Bogdanov <d.bogdanov@yadro.com>
prev parent reply other threads:[~2025-01-15 7:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-15 7:07 [PATCH] target: fix All_commands parameter data header size Chaohai Chen
2025-01-15 7:36 ` Dmitry Bogdanov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250115073608.GA17942@yadro.com \
--to=d.bogdanov@yadro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=target-devel@vger.kernel.org \
--cc=wdhh66@163.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox