lkml.org 
[lkml]   [2011]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 27/40] Staging: hv: storvsc: Handle IDE devices correctly in storvsc_remove()
Date
Properly deal with cleaning up of resources on storvsc_remove().
Keep in mind that while on the scsi side, we don't get called for each
scsi disk configured for the guest, on the IDE side, we will get called
for each IDE device that was probed. Perform all the cleanup in the
context of the HBA owner.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
drivers/staging/hv/storvsc_drv.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index c0d6e16..a6da132 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -350,6 +350,7 @@ static int storvsc_remove(struct hv_device *dev)
struct hv_host_device *host_dev =
(struct hv_host_device *)host->hostdata;
struct storvsc_device *stor_dev = dev->ext;
+ int i;

if (!stor_dev->hba_owner)
return 0;
@@ -359,6 +360,14 @@ static int storvsc_remove(struct hv_device *dev)
scsi_host_put(host);

storvsc_dev_remove(dev);
+
+ for (i = 0; i < 4; i++) {
+ struct hv_device *d = ide_devices[i];
+
+ if (d)
+ storvsc_dev_remove(d);
+ }
+
if (host_dev->request_pool) {
kmem_cache_destroy(host_dev->request_pool);
host_dev->request_pool = NULL;
--
1.7.4.1


\
 
 \ /
  Last update: 2011-06-29 16:27    [W:0.202 / U:4.288 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site