public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Christoph Hellwig <hch@lst.de>, axboe@kernek.dk
Cc: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 1/6] scsi: always zero sshdr in scsi_normalize_sense
Date: Wed, 15 Feb 2017 08:59:23 +0100	[thread overview]
Message-ID: <247fa6d0-ed72-e89b-ad36-8d004a2c9923@suse.de> (raw)
In-Reply-To: <20170214191600.17480-2-hch@lst.de>

On 02/14/2017 08:15 PM, Christoph Hellwig wrote:
> This gives us a clear state even if a command didn't return sense data.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  drivers/scsi/scsi_common.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/scsi_common.c b/drivers/scsi/scsi_common.c
> index b1383a71400e..a75673bb82b3 100644
> --- a/drivers/scsi/scsi_common.c
> +++ b/drivers/scsi/scsi_common.c
> @@ -137,11 +137,11 @@ EXPORT_SYMBOL(int_to_scsilun);
>  bool scsi_normalize_sense(const u8 *sense_buffer, int sb_len,
>  			  struct scsi_sense_hdr *sshdr)
>  {
> +	memset(sshdr, 0, sizeof(struct scsi_sense_hdr));
> +
>  	if (!sense_buffer || !sb_len)
>  		return false;
>  
> -	memset(sshdr, 0, sizeof(struct scsi_sense_hdr));
> -
>  	sshdr->response_code = (sense_buffer[0] & 0x7f);
>  
>  	if (!scsi_sense_valid(sshdr))
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
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)

  reply	other threads:[~2017-02-15  7:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-14 19:15 sense handling improvements Christoph Hellwig
2017-02-14 19:15 ` [PATCH 1/6] scsi: always zero sshdr in scsi_normalize_sense Christoph Hellwig
2017-02-15  7:59   ` Hannes Reinecke [this message]
2017-02-14 19:15 ` [PATCH 2/6] sd: improve TUR handling in sd_check_events Christoph Hellwig
2017-02-15  8:00   ` Hannes Reinecke
2017-02-14 19:15 ` [PATCH 3/6] scsi: make the sense header argument to scsi_test_unit_ready mandatory Christoph Hellwig
2017-02-14 19:15 ` [PATCH 4/6] scsi: simplify scsi_execute_req_flags Christoph Hellwig
2017-02-14 19:15 ` [PATCH 5/6] scsi: merge __scsi_execute into scsi_execute Christoph Hellwig
2017-02-14 19:16 ` [PATCH 6/6] scsi: remove scsi_execute_req_flags Christoph Hellwig
2017-02-15  8:19 ` sense handling improvements Hannes Reinecke
2017-02-15 15:04   ` Christoph Hellwig
2017-02-15 15:30     ` Bart Van Assche
2017-02-16  3:42 ` Martin K. Petersen
2017-02-16 14:33   ` Christoph Hellwig
2017-02-22  7:19   ` Christoph Hellwig
2017-02-22 13:52     ` Martin K. Petersen
2017-02-23  0:51     ` Martin K. Petersen
2017-02-23  9:49       ` Christoph Hellwig
2017-02-23 14:28         ` Martin K. Petersen
2017-02-23 14:31           ` 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=247fa6d0-ed72-e89b-ad36-8d004a2c9923@suse.de \
    --to=hare@suse.de \
    --cc=axboe@kernek.dk \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-scsi@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