Skip to content

Commit 28bd257

Browse files
committed
Allocate memory for Remove lock using ExAllocatePoolWithTag(). (openzfsonwindows#360)
1 parent f1f11fd commit 28bd257

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

module/os/windows/zfs/zfs_windows_zvol_scsi.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ wzvol_decref_target(wzvolContext* zvc)
113113
// when refCnt is 0 we can free the remove lock block.
114114
// All IoReleaseRemoveLock have been called.
115115
atomic_cas_ptr(&zvc->pIoRemLock, pIoRemLock, NULL);
116-
kmem_free(pIoRemLock, sizeof (*pIoRemLock));
116+
ExFreePoolWithTag(pIoRemLock, MP_TAG_GENERAL);
117117
}
118118
}
119119

@@ -156,8 +156,9 @@ wzvol_assign_targetid(zvol_state_t *zv)
156156
{
157157
wzvolContext* zv_targets = STOR_wzvolDriverInfo.zvContextArray;
158158
ASSERT(zv->zv_zso->zso_target_context == NULL);
159-
PIO_REMOVE_LOCK pIoRemLock = kmem_zalloc(sizeof (*pIoRemLock),
160-
KM_SLEEP);
159+
PIO_REMOVE_LOCK pIoRemLock = ExAllocatePoolWithTag(NonPagedPoolNx,
160+
sizeof (*pIoRemLock), MP_TAG_GENERAL);
161+
161162
if (!pIoRemLock) {
162163
dprintf("ZFS: Unable to assign targetid - out of memory.\n");
163164
ASSERT("Unable to assign targetid - out of memory.");
@@ -212,7 +213,7 @@ wzvol_assign_targetid(zvol_state_t *zv)
212213
IoReleaseRemoveLock(pIoRemLock, zv);
213214
}
214215

215-
kmem_free(pIoRemLock, sizeof (*pIoRemLock));
216+
ExFreePoolWithTag(pIoRemLock, MP_TAG_GENERAL);
216217
dprintf("ZFS: Unable to assign targetid - out of room.\n");
217218
ASSERT("Unable to assign targetid - out of room.");
218219
return (0);

0 commit comments

Comments
 (0)