Windows: Remove extent from all skip lists
authorJeffrey Altman <jaltman@your-file-system.com>
Sat, 26 May 2012 22:06:07 +0000 (18:06 -0400)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 6 Jun 2012 15:01:45 +0000 (08:01 -0700)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

src/WINNT/afsrdr/kernel/lib/AFSExtentsSupport.cpp

index 37252eb..342f066 100644 (file)
@@ -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);