https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a5e89014dc943b2cbddb1…
commit a5e89014dc943b2cbddb16fc4d92e13b7e5068e1
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Mon Feb 12 20:45:12 2018 +0100
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Mon Feb 12 20:47:32 2018 +0100
[CDFS_NEW] Fix a bug in Microsoft CDFS implementation where the top level IRP
is set before locking is actually attempted for Cc worker thread (lazy write/read
ahead).
So in case locking fails, the top level IRP is set and never unset, and latter
call will hit the assert where it expects the top level IRP to be NULL.
Should be reported upstream (tm).
CORE-14315
---
drivers/filesystems/cdfs_new/resrcsup.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/filesystems/cdfs_new/resrcsup.c
b/drivers/filesystems/cdfs_new/resrcsup.c
index c9eaa7be26..3bb38bb529 100755
--- a/drivers/filesystems/cdfs_new/resrcsup.c
+++ b/drivers/filesystems/cdfs_new/resrcsup.c
@@ -164,10 +164,20 @@ Return Value:
{
PAGED_CODE();
+#ifdef __REACTOS__
+ if (!ExAcquireResourceSharedLite( Fcb->Resource, Wait )) {
+ return FALSE;
+ }
+#endif
+
NT_ASSERT(IoGetTopLevelIrp() == NULL);
IoSetTopLevelIrp((PIRP)FSRTL_CACHE_TOP_LEVEL_IRP);
+#ifndef __REACTOS__
return ExAcquireResourceSharedLite( Fcb->Resource, Wait );
+#else
+ return TRUE;
+#endif
}