Commit 8caf92d8 authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Christoph Hellwig

Drivers: scsi: storvsc: Filter commands based on the storage protocol version

Going forward it is possible that some of the commands that are not currently
implemented will be implemented on future Windows hosts. Even if they are not
implemented, we are told the host will corrrectly handle unsupported
commands (by returning appropriate return code and sense information).
Make command filtering depend on the host version.
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 52f9614d
...@@ -1553,10 +1553,20 @@ static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd) ...@@ -1553,10 +1553,20 @@ static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd)
struct vmscsi_request *vm_srb; struct vmscsi_request *vm_srb;
struct stor_mem_pools *memp = scmnd->device->hostdata; struct stor_mem_pools *memp = scmnd->device->hostdata;
if (vmstor_current_major <= VMSTOR_WIN8_MAJOR) {
/*
* On legacy hosts filter unimplemented commands.
* Future hosts are expected to correctly handle
* unsupported commands. Furthermore, it is
* possible that some of the currently
* unsupported commands maybe supported in
* future versions of the host.
*/
if (!storvsc_scsi_cmd_ok(scmnd)) { if (!storvsc_scsi_cmd_ok(scmnd)) {
scmnd->scsi_done(scmnd); scmnd->scsi_done(scmnd);
return 0; return 0;
} }
}
request_size = sizeof(struct storvsc_cmd_request); request_size = sizeof(struct storvsc_cmd_request);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment