KDFS-windows-afsrdr-kernel-build-symlink-target-20090109

LICENSE BSD

When the target of a symlink is a volume root, we must return
the control block of the volume root and not the current fcb
which is still referring to the last symlink in the chain.

Be sure to hold the TreeLock while we perform the is volume
test in order to prevent the volume control block from being
torn down.
This commit is contained in:
Jeffrey Altman 2009-01-09 22:14:08 +00:00
parent 957cfdf9b9
commit 8be8c18d01

View File

@ -3948,11 +3948,11 @@ AFSBuildSymLinkTarget( IN ULONGLONG ProcessID,
TRUE);
}
AFSReleaseResource( &pDevExt->Specific.RDR.VolumeTreeLock);
if( pVcb == NULL)
{
AFSReleaseResource( &pDevExt->Specific.RDR.VolumeTreeLock);
if( pCurrentFcb != pTopFcb)
{
@ -3994,11 +3994,15 @@ AFSBuildSymLinkTarget( IN ULONGLONG ProcessID,
if( TargetFcb != NULL)
{
*TargetFcb = pCurrentFcb;
AFSAcquireExcl( &pVcb->NPFcb->Resource,
TRUE);
AFSReleaseResource( &pTopFcb->NPFcb->Resource);
*TargetFcb = pVcb;
}
else if( pCurrentFcb != pTopFcb)
AFSReleaseResource( &pDevExt->Specific.RDR.VolumeTreeLock);
if( pCurrentFcb != pTopFcb)
{
AFSReleaseResource( &pCurrentFcb->NPFcb->Resource);
@ -4011,6 +4015,8 @@ AFSBuildSymLinkTarget( IN ULONGLONG ProcessID,
break;
}
AFSReleaseResource( &pDevExt->Specific.RDR.VolumeTreeLock);
//
// We have the volume node so now search for the entry itself
//