提交 2935a407 编写于 作者: K K. Y. Srinivasan 提交者: Greg Kroah-Hartman

Staging: hv: storvsc: Fix a bug in the storvsc_remove() function

When the storvs driver unloads, we need to accomodate disk cache flushes.
Re-order the code to permit this.
Signed-off-by: NK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: NHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: NAbhishek Kane <v-abkane@microsoft.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 d9bbae83
...@@ -317,22 +317,20 @@ static int storvsc_remove(struct hv_device *dev) ...@@ -317,22 +317,20 @@ static int storvsc_remove(struct hv_device *dev)
struct hv_host_device *host_dev = struct hv_host_device *host_dev =
(struct hv_host_device *)host->hostdata; (struct hv_host_device *)host->hostdata;
DPRINT_INFO(STORVSC, "removing host adapter (%p)...", host);
scsi_remove_host(host);
DPRINT_INFO(STORVSC, "releasing host adapter (%p)...", host);
scsi_host_put(host);
/* /*
* Call to the vsc driver to let it know that the device is being * Call to the vsc driver to let it know that the device is being
* removed * removed
*/ */
storvsc_dev_remove(dev); storvsc_dev_remove(dev);
if (host_dev->request_pool) { if (host_dev->request_pool) {
kmem_cache_destroy(host_dev->request_pool); kmem_cache_destroy(host_dev->request_pool);
host_dev->request_pool = NULL; host_dev->request_pool = NULL;
} }
DPRINT_INFO(STORVSC, "removing host adapter (%p)...", host);
scsi_remove_host(host);
DPRINT_INFO(STORVSC, "releasing host adapter (%p)...", host);
scsi_host_put(host);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册