mirror of
https://github.com/winfsp/winfsp.git
synced 2025-06-15 00:02:46 -05:00
sys: FspAcquireForModWrite: fix deadlock between the Lazy Writer and the Mod Writer.
This commit is contained in:
@ -99,11 +99,20 @@ NTSTATUS FspAcquireForModWrite(
|
|||||||
FSP_ENTER(PAGED_CODE());
|
FSP_ENTER(PAGED_CODE());
|
||||||
|
|
||||||
FSP_FILE_NODE *FileNode = FileObject->FsContext;
|
FSP_FILE_NODE *FileNode = FileObject->FsContext;
|
||||||
|
BOOLEAN Success;
|
||||||
|
|
||||||
ASSERT((PIRP)FSRTL_MOD_WRITE_TOP_LEVEL_IRP == IoGetTopLevelIrp());
|
ASSERT((PIRP)FSRTL_MOD_WRITE_TOP_LEVEL_IRP == IoGetTopLevelIrp());
|
||||||
FspFileNodeAcquireExclusive(FileNode, Full);
|
Success = FspFileNodeTryAcquireExclusiveF(FileNode, FspFileNodeAcquireFull, FALSE);
|
||||||
*ResourceToRelease = FileNode->Header.PagingIoResource;
|
if (Success)
|
||||||
/* ignored by us, but ModWriter expects it; any (non-NULL) resource will do */
|
{
|
||||||
|
*ResourceToRelease = FileNode->Header.PagingIoResource;
|
||||||
|
Result = STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*ResourceToRelease = 0;
|
||||||
|
Result = STATUS_CANT_WAIT;
|
||||||
|
}
|
||||||
|
|
||||||
FSP_LEAVE("FileObject=%p", FileObject);
|
FSP_LEAVE("FileObject=%p", FileObject);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user