Skip to content

Commit

Permalink
Drivers: scsi: storvsc: Filter commands based on the storage protocol…
Browse files Browse the repository at this point in the history
… 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: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
K. Y. Srinivasan authored and Christoph Hellwig committed Jul 25, 2014
1 parent 52f9614 commit 8caf92d
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions drivers/scsi/storvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1553,9 +1553,19 @@ static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd)
struct vmscsi_request *vm_srb;
struct stor_mem_pools *memp = scmnd->device->hostdata;

if (!storvsc_scsi_cmd_ok(scmnd)) {
scmnd->scsi_done(scmnd);
return 0;
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)) {
scmnd->scsi_done(scmnd);
return 0;
}
}

request_size = sizeof(struct storvsc_cmd_request);
Expand Down

0 comments on commit 8caf92d

Please sign in to comment.