Windows: AFSRedir Debug for STATUS_NOT_A_DIRECTORY
authorJeffrey Altman <jaltman@your-file-system.com>
Wed, 21 Mar 2012 14:11:31 +0000 (10:11 -0400)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 22 Mar 2012 20:26:56 +0000 (13:26 -0700)
Add additional logging to handle the case where the afsd_service
returns STATUS_NOT_A_DIRECTORY for eval by id/name.

Change-Id: Ib510fcea6102a92e5e810af5923f06dffbba1ed9
Reviewed-on: http://gerrit.openafs.org/6930
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/AFSCreate.cpp
src/WINNT/afsrdr/kernel/lib/AFSNameSupport.cpp

index 1dd8be6..5867625 100644 (file)
@@ -1781,16 +1781,82 @@ AFSProcessCreate( IN PIRP               Irp,
             if( !NT_SUCCESS( ntStatus))
             {
 
-                AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
-                              AFS_TRACE_LEVEL_ERROR,
-                              "AFSProcessCreate (%08lX) Failed to evaluate object %wZ FID %08lX-%08lX-%08lX-%08lX Status %08lX\n",
-                              Irp,
-                              &pDirEntry->NameInformation.FileName,
-                              pObjectInfo->FileId.Cell,
-                              pObjectInfo->FileId.Volume,
-                              pObjectInfo->FileId.Vnode,
-                              pObjectInfo->FileId.Unique,
-                              ntStatus);
+                if ( ntStatus == STATUS_NOT_A_DIRECTORY)
+                {
+
+                    if ( pParentObjectInfo == pObjectInfo->ParentObjectInformation)
+                    {
+
+                        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                                      AFS_TRACE_LEVEL_ERROR,
+                                      "AFSProcessCreate (%08lX) Failed to evaluate object %wZ FID %08lX-%08lX-%08lX-%08lX PARENT %08lX-%08lX-%08lX-%08lX Status %08lX\n",
+                                      Irp,
+                                      &pDirEntry->NameInformation.FileName,
+                                      pObjectInfo->FileId.Cell,
+                                      pObjectInfo->FileId.Volume,
+                                      pObjectInfo->FileId.Vnode,
+                                      pObjectInfo->FileId.Unique,
+                                      pParentObjectInfo->FileId.Cell,
+                                      pParentObjectInfo->FileId.Volume,
+                                      pParentObjectInfo->FileId.Vnode,
+                                      pParentObjectInfo->FileId.Unique,
+                                      ntStatus);
+                    }
+                    else if ( pObjectInfo->ParentObjectInformation == NULL)
+                    {
+
+                        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                                      AFS_TRACE_LEVEL_ERROR,
+                                      "AFSProcessCreate (%08lX) Failed to evaluate object %wZ FID %08lX-%08lX-%08lX-%08lX PARENT %08lX-%08lX-%08lX-%08lX != NULL Status %08lX\n",
+                                      Irp,
+                                      &pDirEntry->NameInformation.FileName,
+                                      pObjectInfo->FileId.Cell,
+                                      pObjectInfo->FileId.Volume,
+                                      pObjectInfo->FileId.Vnode,
+                                      pObjectInfo->FileId.Unique,
+                                      pParentObjectInfo->FileId.Cell,
+                                      pParentObjectInfo->FileId.Volume,
+                                      pParentObjectInfo->FileId.Vnode,
+                                      pParentObjectInfo->FileId.Unique,
+                                      ntStatus);
+                    }
+                    else
+                    {
+
+                        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                                      AFS_TRACE_LEVEL_ERROR,
+                                      "AFSProcessCreate (%08lX) Failed to evaluate object %wZ FID %08lX-%08lX-%08lX-%08lX PARENT %08lX-%08lX-%08lX-%08lX != %08lX-%08lX-%08lX-%08lX Status %08lX\n",
+                                      Irp,
+                                      &pDirEntry->NameInformation.FileName,
+                                      pObjectInfo->FileId.Cell,
+                                      pObjectInfo->FileId.Volume,
+                                      pObjectInfo->FileId.Vnode,
+                                      pObjectInfo->FileId.Unique,
+                                      pParentObjectInfo->FileId.Cell,
+                                      pParentObjectInfo->FileId.Volume,
+                                      pParentObjectInfo->FileId.Vnode,
+                                      pParentObjectInfo->FileId.Unique,
+                                      pObjectInfo->ParentObjectInformation->FileId.Cell,
+                                      pObjectInfo->ParentObjectInformation->FileId.Volume,
+                                      pObjectInfo->ParentObjectInformation->FileId.Vnode,
+                                      pObjectInfo->ParentObjectInformation->FileId.Unique,
+                                      ntStatus);
+                    }
+                }
+                else
+                {
+
+                    AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                                  AFS_TRACE_LEVEL_ERROR,
+                                  "AFSProcessCreate (%08lX) Failed to evaluate object %wZ FID %08lX-%08lX-%08lX-%08lX Status %08lX\n",
+                                  Irp,
+                                  &pDirEntry->NameInformation.FileName,
+                                  pObjectInfo->FileId.Cell,
+                                  pObjectInfo->FileId.Volume,
+                                  pObjectInfo->FileId.Vnode,
+                                  pObjectInfo->FileId.Unique,
+                                  ntStatus);
+                }
 
                 try_return( ntStatus);
             }
index 3b3f306..bf13d2d 100644 (file)
@@ -63,6 +63,7 @@ AFSLocateNameEntry( IN GUID *AuthGroup,
     BOOLEAN           bAllocatedSymLinkBuffer = FALSE;
     UNICODE_STRING    uniRelativeName, uniNoOpName;
     AFSObjectInfoCB  *pCurrentObject = NULL;
+    AFSObjectInfoCB  *pParentObjectInfo = NULL;
     AFSVolumeCB      *pCurrentVolume = *VolumeCB;
     BOOLEAN           bReleaseCurrentVolume = TRUE;
     BOOLEAN           bSubstitutedName = FALSE;
@@ -250,16 +251,55 @@ AFSLocateNameEntry( IN GUID *AuthGroup,
                 if( !NT_SUCCESS( ntStatus))
                 {
 
-                    AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
-                                  AFS_TRACE_LEVEL_ERROR,
-                                  "AFSLocateNameEntry (FO: %08lX) Failed to evaluate parent %wZ FID %08lX-%08lX-%08lX-%08lX Status %08lX\n",
-                                  FileObject,
-                                  &pDirEntry->NameInformation.FileName,
-                                  pCurrentObject->FileId.Cell,
-                                  pCurrentObject->FileId.Volume,
-                                  pCurrentObject->FileId.Vnode,
-                                  pCurrentObject->FileId.Unique,
-                                  ntStatus);
+                    if ( ntStatus == STATUS_NOT_A_DIRECTORY)
+                    {
+
+                        if ( pCurrentObject->ParentObjectInformation == NULL)
+                        {
+
+                            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                                          AFS_TRACE_LEVEL_ERROR,
+                                          "AFSLocateNameEntry (FO: %08lX) Failed to evaluate object %wZ FID %08lX-%08lX-%08lX-%08lX PARENT NULL Status %08lX\n",
+                                          FileObject,
+                                          &pDirEntry->NameInformation.FileName,
+                                          pCurrentObject->FileId.Cell,
+                                          pCurrentObject->FileId.Volume,
+                                          pCurrentObject->FileId.Vnode,
+                                          pCurrentObject->FileId.Unique,
+                                          ntStatus);
+                        }
+                        else
+                        {
+
+                            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                                          AFS_TRACE_LEVEL_ERROR,
+                                          "AFSLocateNameEntry (FO: %08lX) Failed to evaluate object %wZ FID %08lX-%08lX-%08lX-%08lX PARENT %08lX-%08lX-%08lX-%08lX Status %08lX\n",
+                                          FileObject,
+                                          &pDirEntry->NameInformation.FileName,
+                                          pCurrentObject->FileId.Cell,
+                                          pCurrentObject->FileId.Volume,
+                                          pCurrentObject->FileId.Vnode,
+                                          pCurrentObject->FileId.Unique,
+                                          pCurrentObject->ParentObjectInformation->FileId.Cell,
+                                          pCurrentObject->ParentObjectInformation->FileId.Volume,
+                                          pCurrentObject->ParentObjectInformation->FileId.Vnode,
+                                          pCurrentObject->ParentObjectInformation->FileId.Unique,
+                                          ntStatus);
+                        }
+                    }
+                    else
+                    {
+                        AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                                      AFS_TRACE_LEVEL_ERROR,
+                                      "AFSLocateNameEntry (FO: %08lX) Failed to evaluate parent %wZ FID %08lX-%08lX-%08lX-%08lX Status %08lX\n",
+                                      FileObject,
+                                      &pDirEntry->NameInformation.FileName,
+                                      pCurrentObject->FileId.Cell,
+                                      pCurrentObject->FileId.Volume,
+                                      pCurrentObject->FileId.Vnode,
+                                      pCurrentObject->FileId.Unique,
+                                      ntStatus);
+                    }
 
                     try_return( ntStatus);
                 }
@@ -3783,6 +3823,16 @@ AFSCheckCellName( IN GUID *AuthGroup,
         if( !NT_SUCCESS( ntStatus))
         {
 
+            AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+                          AFS_TRACE_LEVEL_WARNING,
+                          "AFSCheckCellName entry %wZ does not exist parent FID %08lX-%08lX-%08lX-%08lX Status %08lX\n",
+                          &CellName,
+                          AFSGlobalRoot->ObjectInformation.FileId.Cell,
+                          AFSGlobalRoot->ObjectInformation.FileId.Volume,
+                          AFSGlobalRoot->ObjectInformation.FileId.Vnode,
+                          AFSGlobalRoot->ObjectInformation.FileId.Unique,
+                          ntStatus);
+
             try_return( ntStatus);
         }