Windows: Delay MP Target evaluation until required
authorJeffrey Altman <jaltman@your-file-system.com>
Sat, 17 Aug 2013 16:51:06 +0000 (12:51 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Wed, 21 Aug 2013 12:09:15 +0000 (05:09 -0700)
Do not evaluate the Target FID of a mount point until such time
as the target directory must be accessed.

Change-Id: I8aa0da50256cacc4433fad6c7675ca8bd3bd5eb7
Reviewed-on: http://gerrit.openafs.org/10154
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsrdr/kernel/lib/AFSCreate.cpp
src/WINNT/afsrdr/kernel/lib/AFSDirControl.cpp
src/WINNT/afsrdr/kernel/lib/AFSFSControl.cpp
src/WINNT/afsrdr/kernel/lib/AFSFileInfo.cpp
src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp
src/WINNT/afsrdr/kernel/lib/AFSNameSupport.cpp
src/WINNT/afsrdr/kernel/lib/Include/AFSCommon.h
src/WINNT/afsrdr/user/RDRFunction.c

index e661ce8..4a70c1d 100644 (file)
@@ -1347,6 +1347,7 @@ AFSCommonCreate( IN PDEVICE_OBJECT DeviceObject,
                                    pVolumeCB,
                                    pParentDirectoryCB,
                                    pDirectoryCB,
+                                  bOpenedReparsePoint,
                                    &pFcb,
                                    &pCcb);
 
@@ -2824,6 +2825,7 @@ AFSProcessOpen( IN PIRP Irp,
                 IN AFSVolumeCB *VolumeCB,
                 IN AFSDirectoryCB *ParentDirCB,
                 IN AFSDirectoryCB *DirectoryCB,
+               IN BOOLEAN bOpenedReparsePoint,
                 OUT AFSFcb **Fcb,
                 OUT AFSCcb **Ccb)
 {
@@ -2890,7 +2892,7 @@ AFSProcessOpen( IN PIRP Irp,
 
         ntStatus = AFSValidateEntry( DirectoryCB,
                                      AuthGroup,
-                                     FALSE,
+                                    bOpenedReparsePoint,
                                      TRUE);
 
         if( !NT_SUCCESS( ntStatus))
index 27f1690..cc8b41e 100644 (file)
@@ -491,7 +491,8 @@ AFSQueryDirectory( IN PIRP Irp)
                           pFcb->ObjectInformation->FileId.Unique));
 
             ntStatus = AFSVerifyEntry( &pCcb->AuthGroup,
-                                       pCcb->DirectoryCB);
+                                      pCcb->DirectoryCB,
+                                      FALSE);
 
             if( !NT_SUCCESS( ntStatus))
             {
@@ -886,7 +887,7 @@ AFSQueryDirectory( IN PIRP Irp)
 
                 ntStatus = AFSValidateEntry( pDirEntry,
                                              &pCcb->AuthGroup,
-                                             FALSE,
+                                            TRUE,
                                              FALSE);
                 if ( NT_SUCCESS( ntStatus))
                 {
index 0557e1e..d56f90d 100644 (file)
@@ -410,7 +410,8 @@ AFSProcessUserFsRequest( IN PIRP Irp)
                                   pFcb->ObjectInformation->FileId.Unique));
 
                     ntStatus = AFSVerifyEntry( &pCcb->AuthGroup,
-                                               pCcb->DirectoryCB);
+                                              pCcb->DirectoryCB,
+                                              FALSE);
 
                     if( !NT_SUCCESS( ntStatus))
                     {
index 363e818..18eafc3 100644 (file)
@@ -103,7 +103,8 @@ AFSQueryFileInfo( IN PDEVICE_OBJECT LibDeviceObject,
                                      &stAuthGroup);
 
             ntStatus = AFSVerifyEntry( &stAuthGroup,
-                                       pCcb->DirectoryCB);
+                                      pCcb->DirectoryCB,
+                                      FALSE);
 
             if ( NT_SUCCESS( ntStatus))
             {
index 85e7625..129f93d 100644 (file)
@@ -2883,7 +2883,8 @@ AFSInvalidateAllVolumes( VOID)
 
 NTSTATUS
 AFSVerifyEntry( IN GUID *AuthGroup,
-                IN AFSDirectoryCB *DirEntry)
+               IN AFSDirectoryCB *DirEntry,
+               IN BOOLEAN bFollowMountPoint)
 {
 
     NTSTATUS ntStatus = STATUS_SUCCESS;
@@ -2905,7 +2906,7 @@ AFSVerifyEntry( IN GUID *AuthGroup,
 
         ntStatus = AFSEvaluateTargetByID( pObjectInfo,
                                           AuthGroup,
-                                          FALSE,
+                                         bFollowMountPoint ? FALSE : TRUE,
                                           &pDirEnumEntry);
 
         if( !NT_SUCCESS( ntStatus))
index b0a6ae0..a32de1d 100644 (file)
@@ -258,7 +258,8 @@ AFSLocateNameEntry( IN GUID *AuthGroup,
                                 TRUE);
 
                 ntStatus = AFSVerifyEntry( AuthGroup,
-                                           pDirEntry);
+                                          pDirEntry,
+                                          FALSE);
 
                 AFSReleaseResource( pCurrentObject->Specific.Directory.DirectoryNodeHdr.TreeLock);
 
@@ -438,7 +439,8 @@ AFSLocateNameEntry( IN GUID *AuthGroup,
                         //
 
                         ntStatus = AFSVerifyEntry( AuthGroup,
-                                                   pDirEntry);
+                                                  pDirEntry,
+                                                  FALSE);
 
                         AFSReleaseResource( pCurrentObject->Specific.Directory.DirectoryNodeHdr.TreeLock);
 
@@ -1879,7 +1881,8 @@ AFSLocateNameEntry( IN GUID *AuthGroup,
                                         TRUE);
 
                         ntStatus = AFSVerifyEntry( AuthGroup,
-                                                   pParentDirEntry);
+                                                  pParentDirEntry,
+                                                  FALSE);
 
                         AFSReleaseResource( pParentDirEntry->ObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock);
 
@@ -2451,7 +2454,8 @@ AFSCreateDirEntry( IN GUID            *AuthGroup,
                           ParentObjectInfo->FileId.Unique));
 
             ntStatus = AFSVerifyEntry( AuthGroup,
-                                       ParentDirCB);
+                                      ParentDirCB,
+                                      FALSE);
 
             if( !NT_SUCCESS( ntStatus))
             {
@@ -3236,7 +3240,8 @@ AFSParseName( IN PIRP Irp,
                                 TRUE);
 
                 ntStatus = AFSVerifyEntry( AuthGroup,
-                                           pDirEntry);
+                                          pDirEntry,
+                                          FALSE);
 
                 AFSReleaseResource( pDirEntry->ObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock);
 
index 45a1358..34bee1e 100644 (file)
@@ -326,6 +326,7 @@ AFSProcessOpen( IN PIRP Irp,
                 IN AFSVolumeCB *VolumeCB,
                 IN AFSDirectoryCB *ParentDirCB,
                 IN AFSDirectoryCB *DirectoryCB,
+               IN BOOLEAN bOpenedReparsePoint,
                 OUT AFSFcb **Fcb,
                 OUT AFSCcb **Ccb);
 
@@ -1233,7 +1234,8 @@ AFSInvalidateAllVolumes( VOID);
 
 NTSTATUS
 AFSVerifyEntry( IN GUID *AuthGroup,
-                IN AFSDirectoryCB *DirectoryCB);
+               IN AFSDirectoryCB *DirectoryCB,
+               IN BOOLEAN bFollowMountPoint);
 
 NTSTATUS
 AFSSetVolumeState( IN AFSVolumeStatusCB *VolumeStatus);
index 690930a..764635b 100644 (file)
@@ -1277,7 +1277,8 @@ RDR_EvaluateNodeByName( IN cm_user_t *userp,
                                         dscp, scp, userp, &req,
                                         FileName, shortName,
                                         (bWow64 ? RDR_POP_WOW64 : 0) |
-                                        (bNoFollow ? 0 : (RDR_POP_FOLLOW_MOUNTPOINTS | RDR_POP_EVALUATE_SYMLINKS)),
+                                       (bNoFollow ? 0 : RDR_POP_FOLLOW_MOUNTPOINTS) |
+                                       RDR_POP_EVALUATE_SYMLINKS,
                                         0, NULL, &dwRemaining);
         if (bHoldFid)
             RDR_FlagScpInUse( scp, FALSE );
@@ -1433,7 +1434,8 @@ RDR_EvaluateNodeByID( IN cm_user_t *userp,
     code = RDR_PopulateCurrentEntry(pCurrentEntry, dwRemaining,
                                     dscp, scp, userp, &req, NULL, NULL,
                                     (bWow64 ? RDR_POP_WOW64 : 0) |
-                                    (bNoFollow ? 0 : (RDR_POP_FOLLOW_MOUNTPOINTS | RDR_POP_EVALUATE_SYMLINKS)),
+                                   (bNoFollow ? 0 : RDR_POP_FOLLOW_MOUNTPOINTS) |
+                                   RDR_POP_EVALUATE_SYMLINKS,
                                     0, NULL, &dwRemaining);
 
     if (bHoldFid)