Skip to content

Commit

Permalink
Don't hold zfs-enter() across threads
Browse files Browse the repository at this point in the history
Grab locks to eventually hold iocount,
then unlock. iocount stops unmount from
happening.

Signed-off-by: Jorgen Lundman <lundman@lundman.net>
  • Loading branch information
lundman committed Oct 24, 2023
1 parent c8dbc25 commit b6d402c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions module/os/windows/zfs/zfs_vnops_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ zfs_AcquireForLazyWrite(void *Context, BOOLEAN Wait)
zfs_exit(zfsvfs, FTAG);
return (FALSE);
}
zfs_exit(zfsvfs, FTAG);

if (!ExAcquireResourceExclusiveLite(
vp->FileHeader.Resource, Wait)) {
Expand Down Expand Up @@ -194,7 +195,6 @@ zfs_ReleaseFromLazyWrite(void *Context)
(PIRP)FSRTL_CACHE_TOP_LEVEL_IRP)
IoSetTopLevelIrp(NULL);

zfs_exit(zfsvfs, FTAG);
return;
}
dprintf("%s WARNING FAILED\n", __func__);
Expand Down Expand Up @@ -237,6 +237,7 @@ zfs_AcquireForReadAhead(void *Context, BOOLEAN Wait)
zfs_exit(zfsvfs, FTAG);
return (FALSE);
}
zfs_exit(zfsvfs, FTAG);

if (!ExAcquireResourceSharedLite(vp->FileHeader.Resource,
Wait)) {
Expand Down Expand Up @@ -275,7 +276,6 @@ zfs_ReleaseFromReadAhead(void *Context)
(PIRP)FSRTL_CACHE_TOP_LEVEL_IRP)
IoSetTopLevelIrp(NULL);

zfs_exit(zfsvfs, FTAG);
return;
}
dprintf("%s WARNING FAILED\n", __func__);
Expand Down Expand Up @@ -7994,6 +7994,7 @@ fastio_acquire_for_mod_write(PFILE_OBJECT FileObject,
zfs_exit(zfsvfs, FTAG);
return (STATUS_INVALID_PARAMETER);
}
zfs_exit(zfsvfs, FTAG);

znode_t *zp = VTOZ(vp);

Expand Down Expand Up @@ -8041,7 +8042,6 @@ fastio_release_for_mod_write(PFILE_OBJECT FileObject,
}

dprintf("%s WARNING FAILED\n", __func__);
zfs_exit(zfsvfs, FTAG);
return (STATUS_SUCCESS);
}

Expand Down

0 comments on commit b6d402c

Please sign in to comment.