Skip to content

Commit

Permalink
Allocate memory for Remove lock using ExAllocatePoolWithTag(). (openz…
Browse files Browse the repository at this point in the history
  • Loading branch information
datacore-rm committed Mar 11, 2024
1 parent f1f11fd commit 28bd257
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions module/os/windows/zfs/zfs_windows_zvol_scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ wzvol_decref_target(wzvolContext* zvc)
// when refCnt is 0 we can free the remove lock block.
// All IoReleaseRemoveLock have been called.
atomic_cas_ptr(&zvc->pIoRemLock, pIoRemLock, NULL);
kmem_free(pIoRemLock, sizeof (*pIoRemLock));
ExFreePoolWithTag(pIoRemLock, MP_TAG_GENERAL);
}
}

Expand Down Expand Up @@ -156,8 +156,9 @@ wzvol_assign_targetid(zvol_state_t *zv)
{
wzvolContext* zv_targets = STOR_wzvolDriverInfo.zvContextArray;
ASSERT(zv->zv_zso->zso_target_context == NULL);
PIO_REMOVE_LOCK pIoRemLock = kmem_zalloc(sizeof (*pIoRemLock),
KM_SLEEP);
PIO_REMOVE_LOCK pIoRemLock = ExAllocatePoolWithTag(NonPagedPoolNx,
sizeof (*pIoRemLock), MP_TAG_GENERAL);

if (!pIoRemLock) {
dprintf("ZFS: Unable to assign targetid - out of memory.\n");
ASSERT("Unable to assign targetid - out of memory.");
Expand Down Expand Up @@ -212,7 +213,7 @@ wzvol_assign_targetid(zvol_state_t *zv)
IoReleaseRemoveLock(pIoRemLock, zv);
}

kmem_free(pIoRemLock, sizeof (*pIoRemLock));
ExFreePoolWithTag(pIoRemLock, MP_TAG_GENERAL);
dprintf("ZFS: Unable to assign targetid - out of room.\n");
ASSERT("Unable to assign targetid - out of room.");
return (0);
Expand Down

0 comments on commit 28bd257

Please sign in to comment.