mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 16:33:02 -05:00
sys: FspFsvolReadNonCached: acquire FileNode shared
See GitHub issue #291 for discussion
This commit is contained in:
parent
5d0b10d0b6
commit
0296502f24
@ -249,9 +249,9 @@ static NTSTATUS FspFsvolReadNonCached(
|
|||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
return Result;
|
return Result;
|
||||||
|
|
||||||
/* acquire FileNode exclusive Full */
|
/* acquire FileNode shared Full */
|
||||||
Success = DEBUGTEST(90) &&
|
Success = DEBUGTEST(90) &&
|
||||||
FspFileNodeTryAcquireExclusiveF(FileNode, FspFileNodeAcquireFull, CanWait);
|
FspFileNodeTryAcquireSharedF(FileNode, FspFileNodeAcquireFull, CanWait);
|
||||||
if (!Success)
|
if (!Success)
|
||||||
return FspWqRepostIrpWorkItem(Irp, FspFsvolReadNonCached, 0);
|
return FspWqRepostIrpWorkItem(Irp, FspFsvolReadNonCached, 0);
|
||||||
|
|
||||||
@ -279,22 +279,22 @@ static NTSTATUS FspFsvolReadNonCached(
|
|||||||
|
|
||||||
/* if this is a non-cached transfer on a cached file then flush the file */
|
/* if this is a non-cached transfer on a cached file then flush the file */
|
||||||
if (!PagingIo && 0 != FileObject->SectionObjectPointer->DataSectionObject)
|
if (!PagingIo && 0 != FileObject->SectionObjectPointer->DataSectionObject)
|
||||||
{
|
|
||||||
if (!CanWait)
|
|
||||||
{
|
{
|
||||||
FspFileNodeRelease(FileNode, Full);
|
FspFileNodeRelease(FileNode, Full);
|
||||||
|
if (!CanWait)
|
||||||
return FspWqRepostIrpWorkItem(Irp, FspFsvolReadNonCached, 0);
|
return FspWqRepostIrpWorkItem(Irp, FspFsvolReadNonCached, 0);
|
||||||
}
|
|
||||||
|
|
||||||
|
/* need to acquire exclusive for flushing */
|
||||||
|
FspFileNodeAcquireExclusive(FileNode, Full);
|
||||||
Result = FspFileNodeFlushAndPurgeCache(FileNode,
|
Result = FspFileNodeFlushAndPurgeCache(FileNode,
|
||||||
IrpSp->Parameters.Read.ByteOffset.QuadPart,
|
IrpSp->Parameters.Read.ByteOffset.QuadPart,
|
||||||
IrpSp->Parameters.Read.Length,
|
IrpSp->Parameters.Read.Length,
|
||||||
FALSE);
|
FALSE);
|
||||||
if (!NT_SUCCESS(Result))
|
|
||||||
{
|
|
||||||
FspFileNodeRelease(FileNode, Full);
|
FspFileNodeRelease(FileNode, Full);
|
||||||
|
if (!NT_SUCCESS(Result))
|
||||||
return Result;
|
return Result;
|
||||||
}
|
|
||||||
|
FspFileNodeAcquireShared(FileNode, Full);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* trim ReadLength during CreateProcess; resolve bugcheck for filesystem that reports incorrect size */
|
/* trim ReadLength during CreateProcess; resolve bugcheck for filesystem that reports incorrect size */
|
||||||
@ -310,9 +310,6 @@ static NTSTATUS FspFsvolReadNonCached(
|
|||||||
ReadLength = (ULONG)(FileInfo.FileSize - ReadOffset.QuadPart);
|
ReadLength = (ULONG)(FileInfo.FileSize - ReadOffset.QuadPart);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* convert FileNode to shared */
|
|
||||||
FspFileNodeConvertExclusiveToShared(FileNode, Full);
|
|
||||||
|
|
||||||
Request = FspIrpRequest(Irp);
|
Request = FspIrpRequest(Irp);
|
||||||
if (0 == Request)
|
if (0 == Request)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user