diff options
author | K. Y. Srinivasan <kys@microsoft.com> | 2012-10-02 11:03:31 -0700 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2012-10-30 23:26:39 +0000 |
commit | e14e98d41430a225e91800a118272718ddd4969d (patch) | |
tree | 9370874ac0e8c1fbf1daa2f15e2c9a44fbfd22e3 /drivers/staging | |
parent | 532522966057823f75a606d46cfba4ec5bf9dcc0 (diff) |
storvsc: Account for in-transit packets in the RESET path
commit 5c1b10ab7f93d24f29b5630286e323d1c5802d5c upstream.
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>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
[bwh: Backported to 3.2: adjust filename, context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/hv/storvsc_drv.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c index ae8c33e7849..abc5ac568ab 100644 --- a/drivers/staging/hv/storvsc_drv.c +++ b/drivers/staging/hv/storvsc_drv.c @@ -1043,7 +1043,12 @@ static int storvsc_host_reset(struct hv_device *device) /* * 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); cleanup: return ret; |