"AFSSetFileLinkInfo Target %wZ exists DE %p Count %d, performing delete of target\n",
&pTargetDirEntry->NameInformation.FileName,
pTargetDirEntry,
- pTargetDirEntry->DirOpenReferenceCount);
+ lCount);
//
// Pull the directory entry from the parent
pFileLinkInfo->ReplaceIfExists,
&pNewTargetDirEntry);
- if( !NT_SUCCESS( ntStatus))
+ if( ntStatus != STATUS_REPARSE &&
+ !NT_SUCCESS( ntStatus))
{
AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
try_return( ntStatus);
}
- AFSInsertDirectoryNode( pTargetDcb->ObjectInformation,
- pNewTargetDirEntry,
- TRUE);
+ if ( ntStatus != STATUS_REPARSE)
+ {
+
+ AFSInsertDirectoryNode( pTargetDcb->ObjectInformation,
+ pNewTargetDirEntry,
+ TRUE);
+ }
//
// Send notification for the target link file
if( pTargetDirEntry != NULL)
{
+ //
+ // Release DirOpenReferenceCount obtained above
+ //
+
lCount = InterlockedDecrement( &pTargetDirEntry->DirOpenReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
ASSERT( lCount >= 0);
}
+ if( pNewTargetDirEntry != NULL)
+ {
+
+ //
+ // Release DirOpenReferenceCount obtained from AFSNotifyHardLink
+ //
+
+ lCount = InterlockedDecrement( &pNewTargetDirEntry->DirOpenReferenceCount);
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSSetFileLinkInfo Decrement count on %wZ DE %p Ccb %p Cnt %d\n",
+ &pNewTargetDirEntry->NameInformation.FileName,
+ pNewTargetDirEntry,
+ pSrcCcb,
+ lCount);
+
+ ASSERT( lCount >= 0);
+ }
+
if( bReleaseTargetDirLock)
{