Windows: AFSValidateEntry Symlink TargetName
authorJeffrey Altman <jaltman@your-file-system.com>
Sun, 25 Nov 2012 19:30:07 +0000 (14:30 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Mon, 26 Nov 2012 21:24:28 +0000 (13:24 -0800)
During an AFSValidateEntry if the data version of the symlink
object has not changed, do not discard or rebuild the target
name if already assisgned.

Change-Id: If37af308ee48ec761283ff6e831ffa5e06dacf58
Reviewed-on: http://gerrit.openafs.org/8515
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp

index 8eb6604..3a0fde8 100644 (file)
@@ -2788,8 +2788,6 @@ AFSVerifyEntry( IN GUID *AuthGroup,
             case AFS_FILE_TYPE_SYMLINK:
             {
 
-                ASSERT( pDirEnumEntry->TargetNameLength > 0);
-
                 //
                 // Update the metadata for the entry
                 //
@@ -3720,7 +3718,9 @@ AFSUpdateMetaData( IN AFSDirectoryCB *DirEntry,
 
         pObjectInfo->Links = DirEnumEntry->Links;
 
-        if( DirEnumEntry->TargetNameLength > 0)
+        if( DirEnumEntry->TargetNameLength > 0 &&
+            ( DirEntry->NameInformation.TargetName.Length != DirEnumEntry->TargetNameLength ||
+              DirEntry->ObjectInformation->DataVersion.QuadPart != DirEnumEntry->DataVersion.QuadPart))
         {
 
             //
@@ -3762,7 +3762,8 @@ AFSUpdateMetaData( IN AFSDirectoryCB *DirEntry,
 
             AFSReleaseResource( &DirEntry->NonPaged->Lock);
         }
-        else if( DirEntry->NameInformation.TargetName.Length > 0)
+        else if( DirEntry->NameInformation.TargetName.Length > 0 &&
+                 DirEntry->ObjectInformation->DataVersion.QuadPart != DirEnumEntry->DataVersion.QuadPart)
         {
 
             AFSAcquireExcl( &DirEntry->NonPaged->Lock,