public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: James.Bottomley@HansenPartnership.com, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 4 of 4] sd: Correctly handle 6-byte commands with DIX
Date: Sun, 4 Jan 2009 06:28:55 -0700	[thread overview]
Message-ID: <20090104132855.GC2002@parisc-linux.org> (raw)
In-Reply-To: <8676e77c49d4bc933338.1231056274@sermon.lab.mkp.net>

On Sun, Jan 04, 2009 at 03:04:34AM -0500, Martin K. Petersen wrote:
> @@ -374,7 +374,10 @@ void sd_dif_op(struct scsi_cmnd *scmd, u
>  	else
>  		csum_convert = 0;
>  
> +	BUG_ON(dif && (scmd->cmnd[0] == READ_6 || scmd->cmnd[0] == WRITE_6));

This BUG_ON gave me a 'Huh?' moment.  I immediately wondered if it was
user-triggerable.  The answer is "no, this is kosher".  sd_dif_op() is
only called from sd.c where it has chosen which READ_*/WRITE_* opcode to
set up, and it would indeed be an internal bug for this combination of
conditions to exist.

Reviewed-by: Matthew Wilcox <willy@linux.intel.com>

> +
>  	switch (scmd->cmnd[0]) {
> +	case READ_6:
>  	case READ_10:
>  	case READ_12:
>  	case READ_16:
> @@ -390,6 +393,7 @@ void sd_dif_op(struct scsi_cmnd *scmd, u
>  
>  		break;
>  
> +	case WRITE_6:
>  	case WRITE_10:
>  	case WRITE_12:
>  	case WRITE_16:
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

  reply	other threads:[~2009-01-04 13:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-04  8:04 [PATCH 0 of 4] DIF/DIX fixes for 2.6.29 Martin K. Petersen
2009-01-04  8:04 ` [PATCH 1 of 4] scsi: Fix error handling for DIF/DIX Martin K. Petersen
2009-01-04  8:04 ` [PATCH 2 of 4] sd: Show app tag on error Martin K. Petersen
2009-01-04  8:04 ` [PATCH 3 of 4] sd: Fix tagging on platforms with signed char Martin K. Petersen
2009-01-04  8:04 ` [PATCH 4 of 4] sd: Correctly handle 6-byte commands with DIX Martin K. Petersen
2009-01-04 13:28   ` Matthew Wilcox [this message]
2009-01-05  2:35     ` Martin K. Petersen

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=20090104132855.GC2002@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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