]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Windows: AFSFlushExtents QueuedFlushCount leak
authorJeffrey Altman <jaltman@your-file-system.com>
Tue, 23 Oct 2012 00:34:59 +0000 (20:34 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Sun, 28 Oct 2012 01:49:57 +0000 (18:49 -0700)
The FCB QueuedFlushCount was decremented in all code paths
but only incremented if the AuthGroup acquisition succeeded.
Increment the counter before the AuthGroup checks.

Change-Id: I3f58075124412cc4a7ac63dc6a7f90a91af369cf
Reviewed-on: http://gerrit.openafs.org/8303
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
src/WINNT/afsrdr/kernel/lib/AFSExtentsSupport.cpp
src/WINNT/afsrdr/kernel/lib/AFSWorker.cpp

index c8c207bacf80d352b132ff3db91abe0f82255a0e..a5c2984009f987e61fef3c540d5851eecac20c28 100644 (file)
@@ -2585,6 +2585,8 @@ AFSFlushExtents( IN AFSFcb *Fcb,
     __Enter
     {
 
+        lCount = InterlockedIncrement( &Fcb->Specific.File.QueuedFlushCount);
+
         if( pAuthGroup == NULL ||
             RtlCompareMemory( pAuthGroup,
                               &Fcb->NPFcb->Specific.File.ExtentsRequestAuthGroup,
@@ -2616,8 +2618,6 @@ AFSFlushExtents( IN AFSFcb *Fcb,
 
         bExtentsLocked = TRUE;
 
-        lCount = InterlockedIncrement( &Fcb->Specific.File.QueuedFlushCount);
-
         //
         // Clear our queued flush event
         //
@@ -2815,6 +2815,8 @@ try_exit:
 
         lCount = InterlockedDecrement( &Fcb->Specific.File.QueuedFlushCount);
 
+       ASSERT( lCount >= 0);
+
         if( lCount == 0)
         {
 
index 6d649bf613615a23bc11c42b1dbe110e7326d07a..cf28e9f45e5436b03a1da1b3e196e10a00500b4e 100644 (file)
@@ -2258,6 +2258,8 @@ try_exit:
 
         lCount = InterlockedDecrement( &Fcb->Specific.File.QueuedFlushCount);
 
+       ASSERT( lCount >= 0);
+
         if( lCount == 0)
         {