Windows: AFSDeleteObjectInfo AFS_OBJECT_HELD_IN_SERVICE
authorJeffrey Altman <jaltman@your-file-system.com>
Tue, 26 Mar 2013 13:02:00 +0000 (09:02 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Sat, 6 Apr 2013 02:26:09 +0000 (19:26 -0700)
Move the check for AFS_OBJECT_HELD_IN_SERVICE until after the TreeLock
is held.

Change-Id: I38d095c83dc5878770a7a31bee08048a777cb3cb
Reviewed-on: http://gerrit.openafs.org/9674
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/AFSGeneric.cpp

index 7d3e102..3e85ec2 100644 (file)
@@ -6267,10 +6267,6 @@ AFSDeleteObjectInfo( IN AFSObjectInfoCB **ppObjectInfo)
 
     ASSERT( *ppObjectInfo == NULL);
 
-    ASSERT( pObjectInfo->ObjectReferenceCount == 0);
-
-    bHeldInService = BooleanFlagOn( pObjectInfo->Flags, AFS_OBJECT_HELD_IN_SERVICE);
-
     if( !ExIsResourceAcquiredExclusiveLite( pObjectInfo->VolumeCB->ObjectInfoTree.TreeLock))
     {
 
@@ -6282,6 +6278,10 @@ AFSDeleteObjectInfo( IN AFSObjectInfoCB **ppObjectInfo)
         bAcquiredTreeLock = TRUE;
     }
 
+    ASSERT( pObjectInfo->ObjectReferenceCount == 0);
+
+    bHeldInService = BooleanFlagOn( pObjectInfo->Flags, AFS_OBJECT_HELD_IN_SERVICE);
+
     if ( BooleanFlagOn( pObjectInfo->Flags, AFS_OBJECT_FLAGS_PARENT_FID))
     {
 
@@ -6367,6 +6367,8 @@ AFSDeleteObjectInfo( IN AFSObjectInfoCB **ppObjectInfo)
         FileId = pObjectInfo->FileId;
     }
 
+    ASSERT( pObjectInfo->ObjectReferenceCount == 0);
+
     ExDeleteResourceLite( &pObjectInfo->NonPagedInfo->ObjectInfoLock);
 
     ExDeleteResourceLite( &pObjectInfo->NonPagedInfo->DirectoryNodeHdrLock);