From d626fb9563a628a1e1d0abd7548346ae8a8be729 Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Mon, 9 Jan 2023 15:30:42 +0000 Subject: [PATCH] sys: FspReleaseForModWrite In some rare cases and under load the mapped page writer's TopLevelIrp may be trashed by some outside component (observed on Windows 10 1909). For this reason remove an assertion that could trigger in debug builds. --- src/sys/callbacks.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/sys/callbacks.c b/src/sys/callbacks.c index 56e23d81..c178e37c 100644 --- a/src/sys/callbacks.c +++ b/src/sys/callbacks.c @@ -154,8 +154,16 @@ NTSTATUS FspReleaseForModWrite( FSP_FILE_NODE *FileNode = FileObject->FsContext; + /* + * In some rare cases and under load the mapped page writer's TopLevelIrp + * may be trashed by some outside component (observed on Windows 10 1909). + */ + PIRP TopLevelIrp = IoGetTopLevelIrp(); + IoSetTopLevelIrp((PIRP)FSRTL_MOD_WRITE_TOP_LEVEL_IRP); + FspFileNodeRelease(FileNode, Full); - ASSERT((PIRP)FSRTL_MOD_WRITE_TOP_LEVEL_IRP == IoGetTopLevelIrp()); + + IoSetTopLevelIrp(TopLevelIrp); FSP_LEAVE("FileObject=%p", FileObject); }