From: Jeffrey Altman Date: Thu, 7 Mar 2013 22:39:05 +0000 (-0500) Subject: Windows: AFSLocateNameEntry Backup Volume Change X-Git-Tag: upstream/1.8.0_pre1^2~1327 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=540a73dc18bfacebc72dfac2e3c3d9f06c87e18f;p=packages%2Fo%2Fopenafs.git Windows: AFSLocateNameEntry Backup Volume Change When AFSLocateNameEntry() calls AFSBackupEntry() in the name array it is possible that the DirectoryCB returned belongs to a different VolumeCB. If so, pCurrentVolume must be updated and reference counts must be adjusted. Change-Id: I9fcd30374b20f2e1c214a019feeab55c30ce9666 Reviewed-on: http://gerrit.openafs.org/9465 Tested-by: BuildBot Reviewed-by: Rod Widdowson Reviewed-by: Jeffrey Altman --- diff --git a/src/WINNT/afsrdr/kernel/lib/AFSNameSupport.cpp b/src/WINNT/afsrdr/kernel/lib/AFSNameSupport.cpp index 8581153a5..ea7977c06 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSNameSupport.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSNameSupport.cpp @@ -688,6 +688,34 @@ AFSLocateNameEntry( IN GUID *AuthGroup, NULL, lCount); } + + if ( pDirEntry->ObjectInformation->VolumeCB != pCurrentVolume) + { + + lCount = AFSVolumeDecrement( pCurrentVolume, + VolumeReferenceReason); + + AFSDbgLogMsg( AFS_SUBSYSTEM_VOLUME_REF_COUNTING, + AFS_TRACE_LEVEL_VERBOSE, + "AFSLocateNameEntry Decrement count on volume %p Reason %u Cnt %d\n", + pCurrentVolume, + VolumeReferenceReason, + lCount); + + pCurrentVolume = pDirEntry->ObjectInformation->VolumeCB; + + VolumeReferenceReason = AFS_VOLUME_REFERENCE_LOCATE_NAME; + + lCount = AFSVolumeIncrement( pCurrentVolume, + VolumeReferenceReason); + + AFSDbgLogMsg( AFS_SUBSYSTEM_VOLUME_REF_COUNTING, + AFS_TRACE_LEVEL_VERBOSE, + "AFSLocateNameEntry Increment count on volume %p Reason %u Cnt %d\n", + pCurrentVolume, + VolumeReferenceReason, + lCount); + } } else { @@ -1452,6 +1480,34 @@ AFSLocateNameEntry( IN GUID *AuthGroup, } } + if ( pDirEntry->ObjectInformation->VolumeCB != pCurrentVolume) + { + + lCount = AFSVolumeDecrement( pCurrentVolume, + VolumeReferenceReason); + + AFSDbgLogMsg( AFS_SUBSYSTEM_VOLUME_REF_COUNTING, + AFS_TRACE_LEVEL_VERBOSE, + "AFSLocateNameEntry Decrement count on volume %p Reason %u Cnt %d\n", + pCurrentVolume, + VolumeReferenceReason, + lCount); + + pCurrentVolume = pDirEntry->ObjectInformation->VolumeCB; + + VolumeReferenceReason = AFS_VOLUME_REFERENCE_LOCATE_NAME; + + lCount = AFSVolumeIncrement( pCurrentVolume, + VolumeReferenceReason); + + AFSDbgLogMsg( AFS_SUBSYSTEM_VOLUME_REF_COUNTING, + AFS_TRACE_LEVEL_VERBOSE, + "AFSLocateNameEntry Increment count on volume %p Reason %u Cnt %d\n", + pCurrentVolume, + VolumeReferenceReason, + lCount); + } + uniPathName = uniRemainingPath; continue;