Windows: New Trace for DirEntry tracking problem
[openafs.git] / src / WINNT / afsrdr / kernel / lib / AFSGeneric.cpp
index 831cf24..2ace0a0 100644 (file)
@@ -1031,7 +1031,7 @@ AFSInitDirEntry( IN AFSObjectInfoCB *ParentObjectInfo,
 
             bAllocatedObjectCB = TRUE;
 
-            AFSDbgLogMsg( AFS_SUBSYSTEM_CLEANUP_PROCESSING,
+            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
                           AFS_TRACE_LEVEL_VERBOSE,
                           "AFSInitDirEntry initialized object %08lX Parent Object %08lX for %wZ\n",
                           pObjectInfoCB,
@@ -1128,6 +1128,16 @@ AFSInitDirEntry( IN AFSObjectInfoCB *ParentObjectInfo,
                                                                            TRUE);
         }
 
+        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                      AFS_TRACE_LEVEL_VERBOSE,
+                      "AFSInitDirEntry Initialized DE %p for %wZ in parent FID %08lX-%08lX-%08lX-%08lX\n",
+                      pDirNode,
+                      FileName,
+                      ParentObjectInfo->FileId.Cell,
+                      ParentObjectInfo->FileId.Volume,
+                      ParentObjectInfo->FileId.Vnode,
+                      ParentObjectInfo->FileId.Unique);
+
         if( TargetName != NULL &&
             TargetName->Length > 0)
         {
@@ -5962,14 +5972,14 @@ try_exit:
             // offset by the length of the server name
             //
 
-            AFSExFreePool( pwchBuffer);
-
             if( uniFullPathName.Length > 0 &&
                 pwchBuffer != (WCHAR *)((char *)uniFullPathName.Buffer - ulNameDifference))
             {
 
                 AFSExFreePool( uniFullPathName.Buffer);
             }
+
+            AFSExFreePool( pwchBuffer);
         }
     }
 
@@ -6482,14 +6492,14 @@ try_exit:
             // offset by the length of the server name
             //
 
-            AFSExFreePool( pwchBuffer);
-
             if( uniFullPathName.Length > 0 &&
                 pwchBuffer != (WCHAR *)((char *)uniFullPathName.Buffer - ulNameDifference))
             {
 
                 AFSExFreePool( uniFullPathName.Buffer);
             }
+
+            AFSExFreePool( pwchBuffer);
         }
     }
 
@@ -6973,6 +6983,12 @@ AFSRemoveNameEntry( IN AFSObjectInfoCB *ParentObjectInfo,
         if( BooleanFlagOn( DirEntry->Flags, AFS_DIR_ENTRY_NOT_IN_PARENT_TREE))
         {
 
+            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                          AFS_TRACE_LEVEL_VERBOSE,
+                          "AFSRemoveNameEntry DE %p for %wZ has NOT_IN flag set\n",
+                          DirEntry,
+                          &DirEntry->NameInformation.FileName);
+
             try_return( ntStatus);
         }
 
@@ -6982,9 +6998,21 @@ AFSRemoveNameEntry( IN AFSObjectInfoCB *ParentObjectInfo,
         // Remove the entry from the parent tree
         //
 
+        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                      AFS_TRACE_LEVEL_VERBOSE,
+                      "AFSRemoveNameEntry DE %p for %wZ removing from case sensitive tree\n",
+                      DirEntry,
+                      &DirEntry->NameInformation.FileName);
+
         AFSRemoveCaseSensitiveDirEntry( &ParentObjectInfo->Specific.Directory.DirectoryNodeHdr.CaseSensitiveTreeHead,
                                         DirEntry);
 
+        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                      AFS_TRACE_LEVEL_VERBOSE,
+                      "AFSRemoveNameEntry DE %p for %wZ removing from case insensitive tree\n",
+                      DirEntry,
+                      &DirEntry->NameInformation.FileName);
+
         AFSRemoveCaseInsensitiveDirEntry( &ParentObjectInfo->Specific.Directory.DirectoryNodeHdr.CaseInsensitiveTreeHead,
                                           DirEntry);
 
@@ -6996,10 +7024,22 @@ AFSRemoveNameEntry( IN AFSObjectInfoCB *ParentObjectInfo,
             // From the short name tree
             //
 
+            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                          AFS_TRACE_LEVEL_VERBOSE,
+                          "AFSRemoveNameEntry DE %p for %wZ removing from shortname tree\n",
+                          DirEntry,
+                          &DirEntry->NameInformation.FileName);
+
             AFSRemoveShortNameDirEntry( &ParentObjectInfo->Specific.Directory.ShortNameTree,
                                         DirEntry);
         }
 
+        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                      AFS_TRACE_LEVEL_VERBOSE,
+                      "AFSRemoveNameEntry DE %p for %wZ setting NOT_IN flag\n",
+                      DirEntry,
+                      &DirEntry->NameInformation.FileName);
+
         SetFlag( DirEntry->Flags, AFS_DIR_ENTRY_NOT_IN_PARENT_TREE);
 
 try_exit: