From: Hannes Reinecke <hare@suse.de>
To: Sagi Grimberg <sagig@mellanox.com>,
linux-scsi@vger.kernel.org, target-devel@vger.kernel.org
Cc: Christoph Hellwig <hch@infradead.org>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Bart Van Assche <bart.vanassche@sandisk.com>,
"Nicholas A. Bellinger" <nab@linux-iscsi.org>,
James Bottomley <James.Bottomley@HansenPartnership.com>
Subject: Re: [PATCH 1/3] scsi: Fix wrong additional sense length in descriptor format
Date: Mon, 13 Jul 2015 16:05:54 +0200 [thread overview]
Message-ID: <55A3C5C2.9020903@suse.de> (raw)
In-Reply-To: <1436697423-20611-2-git-send-email-sagig@mellanox.com>
On 07/12/2015 12:37 PM, Sagi Grimberg wrote:
> The sense header additional sense length should be the accumulated
> size of all the descriptors. Information descriptor size is 12 bytes.
> When setting the additional sense length we should add 0xc instead of
> 0xa.
>
> Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
> ---
> drivers/scsi/scsi_common.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/scsi_common.c b/drivers/scsi/scsi_common.c
> index 8cfb7ee..fbf137b 100644
> --- a/drivers/scsi/scsi_common.c
> +++ b/drivers/scsi/scsi_common.c
> @@ -260,7 +260,7 @@ void scsi_set_sense_information(u8 *buf, u64 info)
> len = buf[7];
> ucp = (char *)scsi_sense_desc_find(buf, len + 8, 0);
> if (!ucp) {
> - buf[7] = len + 0xa;
> + buf[7] = len + 0xc;
> ucp = buf + 8 + len;
> }
> ucp[0] = 0;
>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
next prev parent reply other threads:[~2015-07-13 14:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-12 10:37 [PATCH 0/3] Descriptor format sense data Sagi Grimberg
2015-07-12 10:37 ` [PATCH 1/3] scsi: Fix wrong additional sense length in descriptor format Sagi Grimberg
2015-07-13 14:05 ` Hannes Reinecke [this message]
2015-07-14 0:52 ` Martin K. Petersen
2015-07-12 10:37 ` [PATCH 2/3] scsi: Protect against buffer possible overflow in scsi_set_sense_information Sagi Grimberg
2015-07-14 0:54 ` Martin K. Petersen
2015-07-12 10:37 ` [PATCH 3/3] target: Return descriptor format sense data Sagi Grimberg
2015-07-14 0:57 ` Martin K. Petersen
2015-07-14 7:17 ` Christoph Hellwig
2015-07-14 8:21 ` Martin K. Petersen
2015-07-14 11:59 ` Sagi Grimberg
2015-07-14 13:34 ` Bart Van Assche
2015-07-14 14:40 ` Christoph Hellwig
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=55A3C5C2.9020903@suse.de \
--to=hare@suse.de \
--cc=James.Bottomley@HansenPartnership.com \
--cc=bart.vanassche@sandisk.com \
--cc=hch@infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=nab@linux-iscsi.org \
--cc=sagig@mellanox.com \
--cc=target-devel@vger.kernel.org \
/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