From ed0eb70f36121ca5cacbf0b87ab9d05bfbb526b8 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sat, 26 May 2012 18:06:07 -0400 Subject: [PATCH] Windows: Remove extent from all skip lists Before freeing the memory for an Extent object, the extent must be removed from all of the extent skip lists. Otherwise, the lists will be corrupted. Change-Id: I891321477b9f0e194544e9e73dad53473f0865b4 Reviewed-on: http://gerrit.openafs.org/7518 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/WINNT/afsrdr/kernel/lib/AFSExtentsSupport.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/WINNT/afsrdr/kernel/lib/AFSExtentsSupport.cpp b/src/WINNT/afsrdr/kernel/lib/AFSExtentsSupport.cpp index 37252eb09b..342f066078 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSExtentsSupport.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSExtentsSupport.cpp @@ -253,7 +253,13 @@ AFSTearDownFcbExtents( IN AFSFcb *Fcb, InterlockedExchangeAdd( &Fcb->Specific.File.ExtentLength, -((LONG)(pEntry->Size/1024))); - RemoveEntryList( le); + for (ULONG i = 0; i < AFS_NUM_EXTENT_LISTS; i ++) + { + if (NULL != pEntry->Lists[i].Flink && !IsListEmpty(&pEntry->Lists[i])) + { + RemoveEntryList( &pEntry->Lists[i] ); + } + } AFSExFreePool( pEntry);