[CDFS_NEW] Fix a bug in Microsoft CDFS implementation where the top level IRP
authorPierre Schweitzer <pierre@reactos.org>
Mon, 12 Feb 2018 19:45:12 +0000 (20:45 +0100)
committerPierre Schweitzer <pierre@reactos.org>
Mon, 12 Feb 2018 19:47:32 +0000 (20:47 +0100)
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

index c9eaa7b..3bb38bb 100755 (executable)
@@ -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
 }
 
 \f