public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: "James E.J. Bottomley" <JBottomley@odin.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"Long Li" <longli@microsoft.com>,
	"Haiyang Zhang" <haiyangz@microsoft.com>,
	"devel@linuxdriverproject.org" <devel@linuxdriverproject.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"KY Srinivasan" <kys@microsoft.com>
Subject: Re: [PATCH] scsi: storvsc: be more picky about scmnd->sc_data_direction
Date: Thu, 13 Aug 2015 10:53:48 +0200	[thread overview]
Message-ID: <87si7nefhf.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <BY2PR0301MB16548730485D11B010D6C4F1A0AB0@BY2PR0301MB1654.namprd03.prod.outlook.com> (KY Srinivasan's message of "Sun, 28 Jun 2015 02:36:22 +0000")

KY Srinivasan <kys@microsoft.com> writes:

>> -----Original Message-----
>> From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com]
>> Sent: Thursday, June 25, 2015 9:12 AM
>> To: linux-scsi@vger.kernel.org
>> Cc: Long Li; KY Srinivasan; Haiyang Zhang; James E.J. Bottomley;
>> devel@linuxdriverproject.org; linux-kernel@vger.kernel.org; Radim Krčmář
>> Subject: [PATCH] scsi: storvsc: be more picky about scmnd-
>> >sc_data_direction
>> 
>> Under the 'default' case in scmnd->sc_data_direction we have 3 options:
>> - DMA_NONE which we handle correctly.
>> - DMA_BIDIRECTIONAL which is never supposed to be set by SCSI stack.
>> - Garbage value.
>> 
>> Do WARN() and return -EINVAL in the last two cases. virtio_scsi does
>> BUG_ON() here but it looks like an overkill.
>> 
>> Reported-by: Radim Krčmář <rkrcmar@redhat.com>
>> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>

Sorry for the ping but it seems the fix never made it to scsi tree...

>> ---
>>  drivers/scsi/storvsc_drv.c | 10 +++++++++-
>>  1 file changed, 9 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
>> index 3c6584f..61f4855 100644
>> --- a/drivers/scsi/storvsc_drv.c
>> +++ b/drivers/scsi/storvsc_drv.c
>> @@ -1598,10 +1598,18 @@ static int storvsc_queuecommand(struct
>> Scsi_Host *host, struct scsi_cmnd *scmnd)
>>  		vm_srb->data_in = READ_TYPE;
>>  		vm_srb->win8_extension.srb_flags |=
>> SRB_FLAGS_DATA_IN;
>>  		break;
>> -	default:
>> +	case DMA_NONE:
>>  		vm_srb->data_in = UNKNOWN_TYPE;
>>  		vm_srb->win8_extension.srb_flags |=
>> SRB_FLAGS_NO_DATA_TRANSFER;
>>  		break;
>> +	default:
>> +		/*
>> +		 * This is DMA_BIDIRECTIONAL or something else we are
>> never
>> +		 * supposed to see here.
>> +		 */
>> +		WARN(1, "Unexpected data direction: %d\n",
>> +		     scmnd->sc_data_direction);
>> +		return -EINVAL;
>>  	}
>> 
>> 
>> --
>> 2.4.3

-- 
  Vitaly

      reply	other threads:[~2015-08-13  8:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-25 16:12 [PATCH] scsi: storvsc: be more picky about scmnd->sc_data_direction Vitaly Kuznetsov
2015-06-28  2:36 ` KY Srinivasan
2015-08-13  8:53   ` Vitaly Kuznetsov [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=87si7nefhf.fsf@vitty.brq.redhat.com \
    --to=vkuznets@redhat.com \
    --cc=JBottomley@odin.com \
    --cc=devel@linuxdriverproject.org \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=longli@microsoft.com \
    --cc=rkrcmar@redhat.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