Windows: AFSDeleteObjectInfo not on volume roots
authorJeffrey Altman <jaltman@your-file-system.com>
Sun, 25 Nov 2012 23:13:53 +0000 (18:13 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Thu, 29 Nov 2012 23:50:26 +0000 (15:50 -0800)
The VolumeCB embeds an ObjectInformationCB structure which must
not be freed by calling AFSDeleteObjectInfo().  Add an assert
in the checked build and return without destroying the object
in the free build.

Change-Id: I77c92fbe0d10252785f4796153d9d824ff074d4c
Reviewed-on: http://gerrit.openafs.org/8520
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 94dddb5..26670a7 100644 (file)
@@ -6588,6 +6588,19 @@ AFSDeleteObjectInfo( IN AFSObjectInfoCB *ObjectInfo)
     BOOLEAN bAcquiredTreeLock = FALSE;
     LONG lCount;
 
+    if ( BooleanFlagOn( ObjectInfo->Flags, AFS_OBJECT_ROOT_VOLUME))
+    {
+
+        //
+        // AFSDeleteObjectInfo should never be called on the ObjectInformationCB
+        // embedded in the VolumeCB.
+        //
+
+        ASSERT( TRUE);
+
+        return;
+    }
+
     if( !ExIsResourceAcquiredExclusiveLite( ObjectInfo->VolumeCB->ObjectInfoTree.TreeLock))
     {