From 9a2bde9e0222edc56560f9d2437af6427f8b7426 Mon Sep 17 00:00:00 2001 From: Jorgen Lundman Date: Tue, 9 Feb 2021 15:02:28 +0900 Subject: [PATCH] Windows: zvol_fini uses system_taskq, fix unload order --- module/os/windows/driver.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/module/os/windows/driver.c b/module/os/windows/driver.c index 261c9912fe7b..66148480be34 100644 --- a/module/os/windows/driver.c +++ b/module/os/windows/driver.c @@ -39,12 +39,13 @@ DRIVER_UNLOAD OpenZFS_Fini; void OpenZFS_Fini(PDRIVER_OBJECT DriverObject) { KdPrintEx((DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, "OpenZFS_Fini\n")); - system_taskq_fini(); zfs_vfsops_fini(); zfs_kmod_fini(); + system_taskq_fini(); + if (STOR_DriverUnload != NULL) { STOR_DriverUnload(DriverObject); STOR_DriverUnload = NULL; @@ -89,6 +90,8 @@ NTSTATUS DriverEntry(_In_ PDRIVER_OBJECT DriverObject, _In_ PUNICODE_STRING pRe kstat_windows_init(pRegistryPath); + system_taskq_init(); + /* * Initialise storport for the ZVOL virtual disks. This also * sets the Driver Callbacks, so we make a copy of them, so @@ -116,7 +119,6 @@ NTSTATUS DriverEntry(_In_ PDRIVER_OBJECT DriverObject, _In_ PUNICODE_STRING pRe /* Register fs with Win */ zfs_vfsops_init(); - system_taskq_init(); KdPrintEx((DPFLTR_IHVDRIVER_ID, DPFLTR_ERROR_LEVEL, "OpenZFS: Started\n")); return STATUS_SUCCESS;