Author: pschweitzer Date: Mon Apr 11 20:29:35 2016 New Revision: 71145
URL: http://svn.reactos.org/svn/reactos?rev=71145&view=rev Log: [NTOSKRNL] In FsRtlAddBaseMcbEntry(), try to detect incompatible LBNs before altering mappings.
This fixes a few tests failures
CORE-11002
Modified: trunk/reactos/ntoskrnl/fsrtl/largemcb.c
Modified: trunk/reactos/ntoskrnl/fsrtl/largemcb.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fsrtl/largemcb.c?r... ============================================================================== --- trunk/reactos/ntoskrnl/fsrtl/largemcb.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/fsrtl/largemcb.c [iso-8859-1] Mon Apr 11 20:29:35 2016 @@ -135,10 +135,12 @@ IN LONGLONG SectorCount) { BOOLEAN Result = TRUE; + BOOLEAN IntResult; PBASE_MCB_INTERNAL Mcb = (PBASE_MCB_INTERNAL)OpaqueMcb; LARGE_MCB_MAPPING_ENTRY Node, NeedleRun; PLARGE_MCB_MAPPING_ENTRY LowerRun, HigherRun; BOOLEAN NewElement; + LONGLONG IntLbn;
DPRINT("FsRtlAddBaseMcbEntry(%p, %I64d, %I64d, %I64d)\n", OpaqueMcb, Vbn, Lbn, SectorCount);
@@ -152,6 +154,16 @@ { Result = FALSE; goto quit; + } + + IntResult = FsRtlLookupBaseMcbEntry(OpaqueMcb, Vbn, &IntLbn, NULL, NULL, NULL, NULL); + if (IntResult) + { + if (IntLbn != -1 && IntLbn != Lbn) + { + Result = FALSE; + goto quit; + } }
/* clean any possible previous entries in our range */