diff --git a/src/sys/write.c b/src/sys/write.c index 2ebe5074..e78fab70 100644 --- a/src/sys/write.c +++ b/src/sys/write.c @@ -247,8 +247,13 @@ static NTSTATUS FspFsvolWriteCached( FILE_END_OF_FILE_INFORMATION EndOfFileInformation; UINT64 WriteEndOffset; BOOLEAN ExtendingFile; + BOOLEAN DeferWrite; BOOLEAN Success; + /* should we defer the write? */ + Success = DEBUGTEST(90) && CcCanIWrite(FileObject, WriteLength, CanWait, Retrying); + DeferWrite = !Success; + /* try to acquire the FileNode Main exclusive */ Success = DEBUGTEST(90) && FspFileNodeTryAcquireExclusiveF(FileNode, FspFileNodeAcquireMain, CanWait); @@ -306,8 +311,7 @@ static NTSTATUS FspFsvolWriteCached( } /* should we defer the write? */ - Success = DEBUGTEST(90) && CcCanIWrite(FileObject, WriteLength, CanWait, Retrying); - if (!Success) + if (DeferWrite) { Result = FspWqCreateIrpWorkItem(Irp, FspFsvolWriteCached, 0); if (NT_SUCCESS(Result))