Skip to content

Commit

Permalink
[SCSI] storvsc: Account for in-transit packets in the RESET path
Browse files Browse the repository at this point in the history
Properly account for I/O in transit before returning from the RESET call.
In the absense of this patch, we could have a situation where the host may
respond to a command that was issued prior to the issuance of the RESET
command at some arbitrary time after responding to the RESET command.
Currently, the host does not do anything with the RESET command.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Cc: stable@vger.kernel.org
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information
K. Y. Srinivasan authored and James Bottomley committed Oct 9, 2012
1 parent f24b5cb commit 5c1b10a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/scsi/storvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,12 @@ static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd)
/*
* At this point, all outstanding requests in the adapter
* should have been flushed out and return to us
* There is a potential race here where the host may be in
* the process of responding when we return from here.
* Just wait for all in-transit packets to be accounted for
* before we return from here.
*/
storvsc_wait_to_drain(stor_device);

return SUCCESS;
}
Expand Down

0 comments on commit 5c1b10a

Please sign in to comment.