mirror of
https://github.com/winfsp/winfsp.git
synced 2025-06-07 12:32:11 -05:00
sys: CcDeferWrite fix
This commit is contained in:
parent
d75e9f7ee6
commit
a2cd6978be
@ -249,22 +249,6 @@ static NTSTATUS FspFsvolWriteCached(
|
|||||||
BOOLEAN ExtendingFile;
|
BOOLEAN ExtendingFile;
|
||||||
BOOLEAN Success;
|
BOOLEAN Success;
|
||||||
|
|
||||||
/* should we defer the write? */
|
|
||||||
Success = DEBUGTEST(90) && CcCanIWrite(FileObject, WriteLength, CanWait, Retrying);
|
|
||||||
if (!Success)
|
|
||||||
{
|
|
||||||
Result = FspWqCreateIrpWorkItem(Irp, FspFsvolWriteCached, 0);
|
|
||||||
if (NT_SUCCESS(Result))
|
|
||||||
{
|
|
||||||
IoMarkIrpPending(Irp);
|
|
||||||
CcDeferWrite(FileObject, FspFsvolWriteCachedDeferred, Irp, 0, WriteLength, Retrying);
|
|
||||||
|
|
||||||
return STATUS_PENDING;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* if we are unable to defer we will go ahead and (try to) service the IRP now! */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* try to acquire the FileNode Main exclusive */
|
/* try to acquire the FileNode Main exclusive */
|
||||||
Success = DEBUGTEST(90) &&
|
Success = DEBUGTEST(90) &&
|
||||||
FspFileNodeTryAcquireExclusiveF(FileNode, FspFileNodeAcquireMain, CanWait);
|
FspFileNodeTryAcquireExclusiveF(FileNode, FspFileNodeAcquireMain, CanWait);
|
||||||
@ -321,6 +305,22 @@ static NTSTATUS FspFsvolWriteCached(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* should we defer the write? */
|
||||||
|
Success = DEBUGTEST(90) && CcCanIWrite(FileObject, WriteLength, CanWait, Retrying);
|
||||||
|
if (!Success)
|
||||||
|
{
|
||||||
|
Result = FspWqCreateIrpWorkItem(Irp, FspFsvolWriteCached, 0);
|
||||||
|
if (NT_SUCCESS(Result))
|
||||||
|
{
|
||||||
|
FspFileNodeRelease(FileNode, Main);
|
||||||
|
IoMarkIrpPending(Irp);
|
||||||
|
CcDeferWrite(FileObject, FspFsvolWriteCachedDeferred, Irp, 0, WriteLength, Retrying);
|
||||||
|
return STATUS_PENDING;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* if we are unable to defer we will go ahead and (try to) service the IRP now! */
|
||||||
|
}
|
||||||
|
|
||||||
/* are we extending the file? */
|
/* are we extending the file? */
|
||||||
if (ExtendingFile)
|
if (ExtendingFile)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user