diff --git a/drivers/filesystems/udfs/read.cpp b/drivers/filesystems/udfs/read.cpp index ca1795add66de..764e8a071158b 100644 --- a/drivers/filesystems/udfs/read.cpp +++ b/drivers/filesystems/udfs/read.cpp @@ -149,6 +149,15 @@ UDFCommonRead( NonCachedIo = TRUE; } + // If this is async paging io then check if we are being called by the mapped page writer. + // Convert it back to synchronous if not. + + if (!Wait && PagingIo) { + + SetFlag(IrpContext->Flags, IRP_CONTEXT_FLAG_WAIT); + Wait = BooleanFlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_WAIT); + } + _SEH2_TRY { // Acquire the appropriate FCB resource shared diff --git a/drivers/filesystems/udfs/write.cpp b/drivers/filesystems/udfs/write.cpp index 75feee29a023a..e5641e881cff3 100644 --- a/drivers/filesystems/udfs/write.cpp +++ b/drivers/filesystems/udfs/write.cpp @@ -132,8 +132,8 @@ UDFCommonWrite( if (!Wait && PagingIo) { - Wait = TRUE; SetFlag(IrpContext->Flags, IRP_CONTEXT_FLAG_WAIT); + Wait = BooleanFlagOn(IrpContext->Flags, IRP_CONTEXT_FLAG_WAIT); } StartingOffset = IrpSp->Parameters.Write.ByteOffset.QuadPart;