BOOLEAN bAllocatedSymLinkBuffer = FALSE;
UNICODE_STRING uniRelativeName, uniNoOpName;
AFSObjectInfoCB *pCurrentObject = NULL;
+ AFSObjectInfoCB *pParentObjectInfo = NULL;
AFSVolumeCB *pCurrentVolume = *VolumeCB;
BOOLEAN bReleaseCurrentVolume = TRUE;
BOOLEAN bSubstitutedName = FALSE;
+ LONG lCount;
__Enter
{
pCurrentObject->FileId.Volume,
pCurrentObject->FileId.Vnode,
pCurrentObject->FileId.Unique,
- ntStatus);
+ STATUS_FILE_DELETED);
try_return( ntStatus = STATUS_FILE_DELETED);
}
pCurrentObject->FileId.Volume,
pCurrentObject->FileId.Vnode,
pCurrentObject->FileId.Unique,
- ntStatus);
+ STATUS_DELETE_PENDING);
try_return( ntStatus = STATUS_DELETE_PENDING);
}
pCurrentObject->FileId.Vnode,
pCurrentObject->FileId.Unique);
+ //
+ // Directory TreeLock should be exclusively held
+ //
+
+ AFSAcquireExcl( pCurrentObject->Specific.Directory.DirectoryNodeHdr.TreeLock,
+ TRUE);
+
ntStatus = AFSVerifyEntry( AuthGroup,
pDirEntry);
+ AFSReleaseResource( pCurrentObject->Specific.Directory.DirectoryNodeHdr.TreeLock);
+
if( !NT_SUCCESS( ntStatus))
{
if( !NT_SUCCESS( ntStatus))
{
- AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
- AFS_TRACE_LEVEL_ERROR,
- "AFSLocateNameEntry (FO: %08lX) Failed to evaluate parent %wZ FID %08lX-%08lX-%08lX-%08lX Status %08lX\n",
- FileObject,
- &pDirEntry->NameInformation.FileName,
- pCurrentObject->FileId.Cell,
- pCurrentObject->FileId.Volume,
- pCurrentObject->FileId.Vnode,
- pCurrentObject->FileId.Unique,
- ntStatus);
+ if ( ntStatus == STATUS_NOT_A_DIRECTORY)
+ {
+
+ if ( pCurrentObject->ParentObjectInformation == NULL)
+ {
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+ AFS_TRACE_LEVEL_ERROR,
+ "AFSLocateNameEntry (FO: %08lX) Failed to evaluate object %wZ FID %08lX-%08lX-%08lX-%08lX PARENT NULL Status %08lX\n",
+ FileObject,
+ &pDirEntry->NameInformation.FileName,
+ pCurrentObject->FileId.Cell,
+ pCurrentObject->FileId.Volume,
+ pCurrentObject->FileId.Vnode,
+ pCurrentObject->FileId.Unique,
+ ntStatus);
+ }
+ else
+ {
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+ AFS_TRACE_LEVEL_ERROR,
+ "AFSLocateNameEntry (FO: %08lX) Failed to evaluate object %wZ FID %08lX-%08lX-%08lX-%08lX PARENT %08lX-%08lX-%08lX-%08lX Status %08lX\n",
+ FileObject,
+ &pDirEntry->NameInformation.FileName,
+ pCurrentObject->FileId.Cell,
+ pCurrentObject->FileId.Volume,
+ pCurrentObject->FileId.Vnode,
+ pCurrentObject->FileId.Unique,
+ pCurrentObject->ParentObjectInformation->FileId.Cell,
+ pCurrentObject->ParentObjectInformation->FileId.Volume,
+ pCurrentObject->ParentObjectInformation->FileId.Vnode,
+ pCurrentObject->ParentObjectInformation->FileId.Unique,
+ ntStatus);
+ }
+ }
+ else
+ {
+ AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+ AFS_TRACE_LEVEL_ERROR,
+ "AFSLocateNameEntry (FO: %08lX) Failed to evaluate parent %wZ FID %08lX-%08lX-%08lX-%08lX Status %08lX\n",
+ FileObject,
+ &pDirEntry->NameInformation.FileName,
+ pCurrentObject->FileId.Cell,
+ pCurrentObject->FileId.Volume,
+ pCurrentObject->FileId.Vnode,
+ pCurrentObject->FileId.Unique,
+ ntStatus);
+ }
try_return( ntStatus);
}
try_return( ntStatus);
}
+ AFSAcquireExcl( pCurrentObject->Specific.Directory.DirectoryNodeHdr.TreeLock,
+ TRUE);
+
AFSAcquireExcl( &pDirEntry->NonPaged->Lock,
TRUE);
pCurrentObject->FileId.Vnode,
pCurrentObject->FileId.Unique);
+ //
+ // Directory TreeLock should be exclusively held
+ //
+
ntStatus = AFSVerifyEntry( AuthGroup,
pDirEntry);
+ AFSReleaseResource( pCurrentObject->Specific.Directory.DirectoryNodeHdr.TreeLock);
+
if( !NT_SUCCESS( ntStatus))
{
continue;
}
}
+ else
+ {
+
+ AFSReleaseResource( pCurrentObject->Specific.Directory.DirectoryNodeHdr.TreeLock);
+ }
//
// If we were given a zero length target name then deny access to the entry
if( pDirEntry->NameInformation.TargetName.Length == 0)
{
- ntStatus = STATUS_ACCESS_DENIED;
+ ntStatus = STATUS_REPARSE_POINT_NOT_RESOLVED;
AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
AFS_TRACE_LEVEL_ERROR,
// Dereference the current entry ..
//
- InterlockedDecrement( &pDirEntry->OpenReferenceCount);
+ lCount = InterlockedDecrement( &pDirEntry->OpenReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
&pDirEntry->NameInformation.FileName,
pDirEntry,
NULL,
- pDirEntry->OpenReferenceCount);
+ lCount);
//
// OK, need to back up one entry for the correct parent since the current
// Increment our reference on this dir entry
//
- InterlockedIncrement( &pDirEntry->OpenReferenceCount);
+ lCount = InterlockedIncrement( &pDirEntry->OpenReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
&pDirEntry->NameInformation.FileName,
pDirEntry,
NULL,
- pDirEntry->OpenReferenceCount);
+ lCount);
if( BooleanFlagOn( pDirEntry->ObjectInformation->Flags, AFS_OBJECT_ROOT_VOLUME))
{
pCurrentObject->FileId.Vnode,
pCurrentObject->FileId.Unique);
- InterlockedDecrement( &pCurrentVolume->VolumeReferenceCount);
+ lCount = InterlockedDecrement( &pCurrentVolume->VolumeReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_VOLUME_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
"AFSLocateNameEntry Decrement count on volume %08lX Cnt %d\n",
pCurrentVolume,
- pCurrentVolume->VolumeReferenceCount);
-
- AFSReleaseResource( pCurrentVolume->VolumeLock);
+ lCount);
pCurrentVolume = AFSGlobalRoot;
- AFSAcquireShared( pCurrentVolume->VolumeLock,
- TRUE);
-
- InterlockedIncrement( &pCurrentVolume->VolumeReferenceCount);
+ lCount = InterlockedIncrement( &pCurrentVolume->VolumeReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_VOLUME_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
"AFSLocateNameEntry Increment count on volume %08lX Cnt %d\n",
pCurrentVolume,
- pCurrentVolume->VolumeReferenceCount);
+ lCount);
}
//
// Dereference our current dir entry
//
- InterlockedDecrement( &pDirEntry->OpenReferenceCount);
+ lCount = InterlockedDecrement( &pDirEntry->OpenReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
&pDirEntry->NameInformation.FileName,
pDirEntry,
NULL,
- pDirEntry->OpenReferenceCount);
+ lCount);
pDirEntry = pCurrentVolume->DirectoryCB;
// Reference the new dir entry
//
- InterlockedIncrement( &pDirEntry->OpenReferenceCount);
+ lCount = InterlockedIncrement( &pDirEntry->OpenReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
&pDirEntry->NameInformation.FileName,
pDirEntry,
NULL,
- pDirEntry->OpenReferenceCount);
+ lCount);
//
// Reset the name array
// Increment our link count
//
- InterlockedIncrement( &pNameArray->LinkCount);
+ lCount = InterlockedIncrement( &pNameArray->LinkCount);
continue;
}
ASSERT( pCurrentVolume->VolumeReferenceCount > 1);
- InterlockedDecrement( &pCurrentVolume->VolumeReferenceCount);
+ lCount = InterlockedDecrement( &pCurrentVolume->VolumeReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_VOLUME_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
pCurrentVolume,
pCurrentVolume->VolumeReferenceCount);
- AFSReleaseResource( pCurrentVolume->VolumeLock);
-
ntStatus = AFSBuildMountPointTarget( AuthGroup,
pDirEntry,
&pCurrentVolume);
bReleaseCurrentVolume = FALSE;
- try_return( ntStatus = STATUS_ACCESS_DENIED);
+ try_return( ntStatus);
}
ASSERT( pCurrentVolume->VolumeReferenceCount > 1);
- ASSERT( ExIsResourceAcquiredLite( pCurrentVolume->VolumeLock));
-
//
- // Replace the current name for the mp with the volume root of the target
+ // The name array stores both the mount point and the target.
+ // Insert the target.
//
- AFSReplaceCurrentElement( pNameArray,
- pCurrentVolume->DirectoryCB);
+ AFSInsertNextElement( pNameArray,
+ pCurrentVolume->DirectoryCB);
//
// We want to restart processing here on the new parent ...
// Deref and ref count the entries
//
- InterlockedDecrement( &pDirEntry->OpenReferenceCount);
+ lCount = InterlockedDecrement( &pDirEntry->OpenReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
&pDirEntry->NameInformation.FileName,
pDirEntry,
NULL,
- pDirEntry->OpenReferenceCount);
+ lCount);
pDirEntry = pCurrentVolume->DirectoryCB;
- InterlockedIncrement( &pDirEntry->OpenReferenceCount);
+ lCount = InterlockedIncrement( &pDirEntry->OpenReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
&pDirEntry->NameInformation.FileName,
pDirEntry,
NULL,
- pDirEntry->OpenReferenceCount);
+ lCount);
pParentDirEntry = NULL;
// Increment our link count
//
- InterlockedIncrement( &pNameArray->LinkCount);
+ lCount = InterlockedIncrement( &pNameArray->LinkCount);
continue;
}
//
// Need to back up one entry in the name array
//
-
- InterlockedDecrement( &pDirEntry->OpenReferenceCount);
+ lCount = InterlockedDecrement( &pDirEntry->OpenReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
&pDirEntry->NameInformation.FileName,
pDirEntry,
NULL,
- pDirEntry->OpenReferenceCount);
+ lCount);
pDirEntry = AFSBackupEntry( NameArray);
try_return(ntStatus = STATUS_OBJECT_PATH_INVALID);
}
- InterlockedIncrement( &pDirEntry->OpenReferenceCount);
+ lCount = InterlockedIncrement( &pDirEntry->OpenReferenceCount);
if( BooleanFlagOn( pDirEntry->ObjectInformation->Flags, AFS_OBJECT_ROOT_VOLUME))
{
pParentDirEntry->ObjectInformation->FileId.Vnode,
pParentDirEntry->ObjectInformation->FileId.Unique);
+ //
+ // Directory TreeLock should be exclusively held
+ //
+
+ AFSAcquireExcl( pParentDirEntry->ObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock,
+ TRUE);
+
ntStatus = AFSVerifyEntry( AuthGroup,
pParentDirEntry);
+ AFSReleaseResource( pParentDirEntry->ObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock);
+
if( !NT_SUCCESS( ntStatus))
{
// Increment our dir entry ref count
//
- InterlockedIncrement( &pDirEntry->OpenReferenceCount);
+ lCount = InterlockedIncrement( &pDirEntry->OpenReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
&pDirEntry->NameInformation.FileName,
pDirEntry,
NULL,
- pDirEntry->OpenReferenceCount);
+ lCount);
}
AFSReleaseResource( pParentDirEntry->ObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock);
AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
AFS_TRACE_LEVEL_ERROR,
- "AFSLocateNameEntry (FO: %08lX) Deleted parent %wZ FID %08lX-%08lX-%08lX-%08lX\n",
+ "AFSLocateNameEntry (FO: %08lX) Deleted entry %wZ FID %08lX-%08lX-%08lX-%08lX\n",
FileObject,
&pDirEntry->NameInformation.FileName,
pCurrentObject->FileId.Cell,
AFSAcquireExcl( pCurrentObject->VolumeCB->ObjectInfoTree.TreeLock,
TRUE);
- if( InterlockedDecrement( &pDirEntry->OpenReferenceCount) == 0)
+ lCount = InterlockedDecrement( &pDirEntry->OpenReferenceCount);
+
+ if( lCount == 0)
{
- AFSDbgLogMsg( AFS_SUBSYSTEM_CLEANUP_PROCESSING,
+ AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING|AFS_SUBSYSTEM_CLEANUP_PROCESSING,
AFS_TRACE_LEVEL_VERBOSE,
"AFSLocateNameEntry Deleting dir entry %08lX (%08lX) for %wZ\n",
pDirEntry,
AFSDeleteDirEntry( pCurrentObject->ParentObjectInformation,
pDirEntry);
- if( pCurrentObject->ObjectReferenceCount == 0)
+ if( pCurrentObject->ObjectReferenceCount <= 0)
{
if( BooleanFlagOn( pCurrentObject->Flags, AFS_OBJECT_INSERTED_HASH_TREE))
// Decrement the previous parent
//
- InterlockedDecrement( &pParentDirEntry->OpenReferenceCount);
+ lCount = InterlockedDecrement( &pParentDirEntry->OpenReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
&pParentDirEntry->NameInformation.FileName,
pParentDirEntry,
NULL,
- pParentDirEntry->OpenReferenceCount);
+ lCount);
//
// If we ended up substituting a name in the component then update
if( pDirEntry != NULL)
{
- InterlockedDecrement( &pDirEntry->OpenReferenceCount);
+ lCount = InterlockedDecrement( &pDirEntry->OpenReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
&pDirEntry->NameInformation.FileName,
pDirEntry,
NULL,
- pDirEntry->OpenReferenceCount);
+ lCount);
}
else if( pParentDirEntry != NULL)
{
- InterlockedDecrement( &pParentDirEntry->OpenReferenceCount);
+ lCount = InterlockedDecrement( &pParentDirEntry->OpenReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
&pParentDirEntry->NameInformation.FileName,
pParentDirEntry,
NULL,
- pParentDirEntry->OpenReferenceCount);
+ lCount);
}
if( bReleaseCurrentVolume)
ASSERT( pCurrentVolume->VolumeReferenceCount > 1);
- ASSERT( ExIsResourceAcquiredLite( pCurrentVolume->VolumeLock));
-
- InterlockedDecrement( &pCurrentVolume->VolumeReferenceCount);
+ lCount = InterlockedDecrement( &pCurrentVolume->VolumeReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_VOLUME_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
"AFSLocateNameEntry Decrement3 count on volume %08lX Cnt %d\n",
pCurrentVolume,
- pCurrentVolume->VolumeReferenceCount);
-
- AFSReleaseResource( pCurrentVolume->VolumeLock);
+ lCount);
}
if( RootPathName->Buffer != uniFullPathName.Buffer)
AFSDirectoryCB *pDirNode = NULL, *pExistingDirNode = NULL;
UNICODE_STRING uniShortName;
LARGE_INTEGER liFileSize = {0,0};
+ LONG lCount;
__Enter
{
if( pExistingDirNode != NULL)
{
+ if (AFSIsEqualFID( &pDirNode->ObjectInformation->FileId,
+ &pExistingDirNode->ObjectInformation->FileId))
+ {
- AFSDeleteDirEntry( ParentObjectInfo,
- pDirNode);
+ AFSDeleteDirEntry( ParentObjectInfo,
+ pDirNode);
- InterlockedIncrement( &pExistingDirNode->OpenReferenceCount);
+ lCount = InterlockedIncrement( &pExistingDirNode->OpenReferenceCount);
- AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
- AFS_TRACE_LEVEL_VERBOSE,
- "AFSCreateDirEntry Increment count on %wZ DE %p Cnt %d\n",
- &pExistingDirNode->NameInformation.FileName,
- pExistingDirNode,
- pExistingDirNode->OpenReferenceCount);
+ AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSCreateDirEntry Increment count on %wZ DE %p Cnt %d\n",
+ &pExistingDirNode->NameInformation.FileName,
+ pExistingDirNode,
+ lCount);
- *DirEntry = pExistingDirNode;
+ *DirEntry = pExistingDirNode;
- AFSReleaseResource( ParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock);
+ AFSReleaseResource( ParentObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock);
- try_return( ntStatus = STATUS_SUCCESS);
+ try_return( ntStatus = STATUS_SUCCESS);
+ }
+ else
+ {
+
+ //
+ // Need to tear down this entry and rebuild it below
+ //
+
+ if( pExistingDirNode->OpenReferenceCount == 0)
+ {
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSCreateDirEntry Different FIDs - Deleting DE %p for %wZ Old FID %08lX-%08lX-%08lX-%08lX New FID %08lX-%08lX-%08lX-%08lX\n",
+ pExistingDirNode,
+ &pExistingDirNode->NameInformation.FileName,
+ pExistingDirNode->ObjectInformation->FileId.Cell,
+ pExistingDirNode->ObjectInformation->FileId.Volume,
+ pExistingDirNode->ObjectInformation->FileId.Vnode,
+ pExistingDirNode->ObjectInformation->FileId.Unique,
+ pDirNode->ObjectInformation->FileId.Cell,
+ pDirNode->ObjectInformation->FileId.Volume,
+ pDirNode->ObjectInformation->FileId.Vnode,
+ pDirNode->ObjectInformation->FileId.Unique);
+
+ AFSDeleteDirEntry( ParentObjectInfo,
+ pExistingDirNode);
+ }
+ else
+ {
+
+ SetFlag( pExistingDirNode->Flags, AFS_DIR_ENTRY_DELETED);
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSCreateDirEntry Different FIDs - Removing DE %p for %wZ Old FID %08lX-%08lX-%08lX-%08lX New FID %08lX-%08lX-%08lX-%08lX\n",
+ pExistingDirNode,
+ &pExistingDirNode->NameInformation.FileName,
+ pExistingDirNode->ObjectInformation->FileId.Cell,
+ pExistingDirNode->ObjectInformation->FileId.Volume,
+ pExistingDirNode->ObjectInformation->FileId.Vnode,
+ pExistingDirNode->ObjectInformation->FileId.Unique,
+ pDirNode->ObjectInformation->FileId.Cell,
+ pDirNode->ObjectInformation->FileId.Volume,
+ pDirNode->ObjectInformation->FileId.Vnode,
+ pDirNode->ObjectInformation->FileId.Unique);
+
+ AFSRemoveNameEntry( ParentObjectInfo,
+ pExistingDirNode);
+ }
+
+ }
}
AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
pDirNode,
TRUE);
- InterlockedIncrement( &pDirNode->OpenReferenceCount);
+ lCount = InterlockedIncrement( &pDirNode->OpenReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
"AFSCreateDirEntry Increment2 count on %wZ DE %p Cnt %d\n",
&pDirNode->NameInformation.FileName,
pDirNode,
- pDirNode->OpenReferenceCount);
+ lCount);
//
// Pass back the dir entry
IN BOOLEAN InsertInEnumList)
{
+ LONG lCount;
+
__Enter
{
AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
AFS_TRACE_LEVEL_VERBOSE,
- "AFSInsertDirectoryNode Inserting entry %08lX %wZ FID %08lX-%08lX-%08lX-%08lXStatus %08lX\n",
+ "AFSInsertDirectoryNode Inserting entry %08lX %wZ FID %08lX-%08lX-%08lX-%08lX\n",
DirEntry,
&DirEntry->NameInformation.FileName,
DirEntry->ObjectInformation->FileId.Cell,
SetFlag( DirEntry->Flags, AFS_DIR_ENTRY_INSERTED_ENUM_LIST);
- InterlockedIncrement( &ParentObjectInfo->Specific.Directory.DirectoryNodeCount);
+ lCount = InterlockedIncrement( &ParentObjectInfo->Specific.Directory.DirectoryNodeCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_DIR_NODE_COUNT,
AFS_TRACE_LEVEL_VERBOSE,
"AFSInsertDirectoryNode Adding entry %wZ Inc Count %d to parent FID %08lX-%08lX-%08lX-%08lX\n",
- &DirEntry->NameInformation.FileName,
- ParentObjectInfo->Specific.Directory.DirectoryNodeCount,
- ParentObjectInfo->FileId.Cell,
- ParentObjectInfo->FileId.Volume,
- ParentObjectInfo->FileId.Vnode,
- ParentObjectInfo->FileId.Unique);
+ &DirEntry->NameInformation.FileName,
+ lCount,
+ ParentObjectInfo->FileId.Cell,
+ ParentObjectInfo->FileId.Volume,
+ ParentObjectInfo->FileId.Vnode,
+ ParentObjectInfo->FileId.Unique);
}
}
{
NTSTATUS ntStatus = STATUS_SUCCESS;
+ LONG lCount;
__Enter
{
ASSERT( DirEntry->ObjectInformation->ObjectReferenceCount > 0);
- if( InterlockedDecrement( &DirEntry->ObjectInformation->ObjectReferenceCount) == 0)
+ lCount = InterlockedDecrement( &DirEntry->ObjectInformation->ObjectReferenceCount);
+
+ if( lCount <= 0)
{
SetFlag( DirEntry->ObjectInformation->Flags, AFS_OBJECT_FLAGS_DELETED);
}
{
NTSTATUS ntStatus = STATUS_SUCCESS;
+ LONG lCount;
__Enter
{
ASSERT( ParentObjectInfo->Specific.Directory.DirectoryNodeCount > 0);
- InterlockedDecrement( &ParentObjectInfo->Specific.Directory.DirectoryNodeCount);
+ lCount = InterlockedDecrement( &ParentObjectInfo->Specific.Directory.DirectoryNodeCount);
ClearFlag( DirEntry->Flags, AFS_DIR_ENTRY_INSERTED_ENUM_LIST);
AFS_TRACE_LEVEL_VERBOSE,
"AFSRemoveDirNodeFromParent Removing entry %wZ Dec Count %d to parent FID %08lX-%08lX-%08lX-%08lX\n",
&DirEntry->NameInformation.FileName,
- ParentObjectInfo->Specific.Directory.DirectoryNodeCount,
+ lCount,
ParentObjectInfo->FileId.Cell,
ParentObjectInfo->FileId.Volume,
ParentObjectInfo->FileId.Vnode,
AFSFcb *pRelatedFcb = NULL;
BOOLEAN bReleaseTreeLock = FALSE;
BOOLEAN bIsAllShare = FALSE;
+ LONG lCount;
__Enter
{
*FileName = pIrpSp->FileObject->FileName;
//
- // Grab the root node exclusive before returning
+ // Grab the root node while checking state
//
- AFSAcquireExcl( pVolumeCB->VolumeLock,
- TRUE);
+ AFSAcquireShared( pVolumeCB->VolumeLock,
+ TRUE);
if( BooleanFlagOn( pVolumeCB->ObjectInformation.Flags, AFS_OBJECT_FLAGS_OBJECT_INVALID) ||
BooleanFlagOn( pVolumeCB->Flags, AFS_VOLUME_FLAGS_OFFLINE))
}
}
- AFSConvertToShared( pVolumeCB->VolumeLock);
+ AFSReleaseResource( pVolumeCB->VolumeLock);
if( BooleanFlagOn( pDirEntry->ObjectInformation->Flags, AFS_OBJECT_FLAGS_VERIFY))
{
pDirEntry->ObjectInformation->FileId.Vnode,
pDirEntry->ObjectInformation->FileId.Unique);
+ //
+ // Directory TreeLock should be exclusively held
+ //
+
+ AFSAcquireExcl( pDirEntry->ObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock,
+ TRUE);
+
ntStatus = AFSVerifyEntry( AuthGroup,
pDirEntry);
+ AFSReleaseResource( pDirEntry->ObjectInformation->Specific.Directory.DirectoryNodeHdr.TreeLock);
+
if( !NT_SUCCESS( ntStatus))
{
pDirEntry->ObjectInformation->FileId.Unique,
ntStatus);
- AFSReleaseResource( pVolumeCB->VolumeLock);
-
try_return( ntStatus);
}
}
"AFSParseName (%08lX) Failed to allocate full name buffer\n",
Irp);
- AFSReleaseResource( pVolumeCB->VolumeLock);
-
try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
}
AFSExFreePool( uniFullName.Buffer);
- AFSReleaseResource( pVolumeCB->VolumeLock);
-
try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
}
AFSExFreePool( uniFullName.Buffer);
- AFSReleaseResource( pVolumeCB->VolumeLock);
-
try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
}
AFSExFreePool( uniFullName.Buffer);
- AFSReleaseResource( pVolumeCB->VolumeLock);
-
try_return( ntStatus);
}
// Increment our volume reference count
//
- InterlockedIncrement( &pVolumeCB->VolumeReferenceCount);
+ lCount = InterlockedIncrement( &pVolumeCB->VolumeReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_VOLUME_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
"AFSParseName Increment count on volume %08lX Cnt %d\n",
pVolumeCB,
- pVolumeCB->VolumeReferenceCount);
+ lCount);
*ParentDirectoryCB = pDirEntry;
- InterlockedIncrement( &pDirEntry->OpenReferenceCount);
+ lCount = InterlockedIncrement( &pDirEntry->OpenReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
&pDirEntry->NameInformation.FileName,
pDirEntry,
NULL,
- pDirEntry->OpenReferenceCount);
+ lCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
AFS_TRACE_LEVEL_VERBOSE_2,
}
}
+ if( FsRtlDoesNameContainWildCards( &uniFullName))
+ {
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+ AFS_TRACE_LEVEL_ERROR,
+ "AFSParseName (%08lX) Component %wZ contains wild cards\n",
+ Irp,
+ &uniFullName);
+
+ try_return( ntStatus = STATUS_OBJECT_NAME_INVALID);
+ }
+
AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
AFS_TRACE_LEVEL_VERBOSE_2,
"AFSParseName (%08lX) Processing full name %wZ\n",
// Be sure we are online and ready to go
//
- AFSAcquireExcl( AFSGlobalRoot->VolumeLock,
- TRUE);
+ AFSAcquireShared( AFSGlobalRoot->VolumeLock,
+ TRUE);
if( BooleanFlagOn( AFSGlobalRoot->ObjectInformation.Flags, AFS_OBJECT_FLAGS_OBJECT_INVALID) ||
BooleanFlagOn( AFSGlobalRoot->Flags, AFS_VOLUME_FLAGS_OFFLINE))
}
}
+ AFSReleaseResource( AFSGlobalRoot->VolumeLock);
+
if( !BooleanFlagOn( AFSGlobalRoot->ObjectInformation.Flags, AFS_OBJECT_FLAGS_DIRECTORY_ENUMERATED))
{
Irp,
ntStatus);
- AFSReleaseResource( AFSGlobalRoot->VolumeLock);
-
try_return( ntStatus);
}
}
"AFSParseName (%08lX) Returning global root access\n",
Irp);
- InterlockedIncrement( &AFSGlobalRoot->DirectoryCB->OpenReferenceCount);
+ lCount = InterlockedIncrement( &AFSGlobalRoot->DirectoryCB->OpenReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
&AFSGlobalRoot->DirectoryCB->NameInformation.FileName,
AFSGlobalRoot->DirectoryCB,
NULL,
- AFSGlobalRoot->DirectoryCB->OpenReferenceCount);
-
- AFSReleaseResource( AFSGlobalRoot->VolumeLock);
+ lCount);
*VolumeCB = NULL;
&uniComponentName,
&uniRemainingPath);
+ if( FsRtlDoesNameContainWildCards( &uniFullName))
+ {
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+ AFS_TRACE_LEVEL_ERROR,
+ "AFSParseName (%08lX) Component %wZ contains wild cards\n",
+ Irp,
+ &uniComponentName);
+
+ try_return( ntStatus = STATUS_OBJECT_NAME_INVALID);
+ }
+
//
// If this is the ALL access then perform some additional processing
//
- if( RtlCompareUnicodeString( &uniComponentName,
+ if( uniComponentName.Length == 0 ||
+ RtlCompareUnicodeString( &uniComponentName,
&AFSGlobalRootName,
TRUE) == 0)
{
"AFSParseName (%08lX) Returning global root access\n",
Irp);
- InterlockedIncrement( &AFSGlobalRoot->DirectoryCB->OpenReferenceCount);
+ lCount = InterlockedIncrement( &AFSGlobalRoot->DirectoryCB->OpenReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
&AFSGlobalRoot->DirectoryCB->NameInformation.FileName,
AFSGlobalRoot->DirectoryCB,
NULL,
- AFSGlobalRoot->DirectoryCB->OpenReferenceCount);
-
- AFSReleaseResource( AFSGlobalRoot->VolumeLock);
+ lCount);
*VolumeCB = NULL;
"AFSParseName (%08lX) Returning root PIOCtl access\n",
Irp);
- InterlockedIncrement( &AFSGlobalRoot->DirectoryCB->OpenReferenceCount);
+ lCount = InterlockedIncrement( &AFSGlobalRoot->DirectoryCB->OpenReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
&AFSGlobalRoot->DirectoryCB->NameInformation.FileName,
AFSGlobalRoot->DirectoryCB,
NULL,
- AFSGlobalRoot->DirectoryCB->OpenReferenceCount);
-
- AFSReleaseResource( AFSGlobalRoot->VolumeLock);
+ lCount);
ClearFlag( *ParseFlags, AFS_PARSE_FLAG_ROOT_ACCESS);
Irp,
&uniComponentName);
- AFSReleaseResource( AFSGlobalRoot->VolumeLock);
-
//
// Add in the full share name to pass back
//
ClearFlag( *ParseFlags, AFS_PARSE_FLAG_ROOT_ACCESS);
- InterlockedIncrement( &pDirEntry->OpenReferenceCount);
+ lCount = InterlockedIncrement( &pDirEntry->OpenReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
&pDirEntry->NameInformation.FileName,
pDirEntry,
NULL,
- pDirEntry->OpenReferenceCount);
+ lCount);
try_return( ntStatus = STATUS_SUCCESS);
}
if( !NT_SUCCESS( ntStatus))
{
- AFSReleaseResource( AFSGlobalRoot->VolumeLock);
if ( bIsAllShare &&
uniRemainingPath.Length == 0 &&
AFSReleaseResource( AFSGlobalRoot->ObjectInformation.Specific.Directory.DirectoryNodeHdr.TreeLock);
}
+
//
// Be sure we are starting from the correct volume
//
pVolumeCB = pDirEntry->ObjectInformation->VolumeCB;
//
+ // Init our name array
+ //
+
+ pNameArray = AFSInitNameArray( AFSGlobalRoot->DirectoryCB,
+ 0);
+
+ if( pNameArray == NULL)
+ {
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSParseName (%08lX) Failed to initialize name array\n",
+ Irp);
+
+ try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
+ }
+
+ ntStatus = AFSInsertNextElement( pNameArray,
+ pVolumeCB->DirectoryCB);
+
+ if ( ntStatus)
+ {
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSParseName (%08lX) Failed to insert name array element\n",
+ Irp);
+
+ try_return( ntStatus);
+ }
+
+ //
// In this case don't add back in the 'share' name since that is where we are
// starting. Just put the leading slash back in
//
pVolumeCB = AFSGlobalRoot;
//
+ // Init our name array
+ //
+
+ pNameArray = AFSInitNameArray( AFSGlobalRoot->DirectoryCB,
+ 0);
+ if( pNameArray == NULL)
+ {
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSParseName (%08lX) Failed to initialize name array\n",
+ Irp);
+
+ try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
+ }
+
+ //
// Add back in the 'share' portion of the name since we will parse it out on return
//
uniRemainingPath.Length += sizeof( WCHAR);
uniRemainingPath.MaximumLength += sizeof( WCHAR);
- InterlockedIncrement( &pVolumeCB->DirectoryCB->OpenReferenceCount);
+ lCount = InterlockedIncrement( &pVolumeCB->DirectoryCB->OpenReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
&pVolumeCB->DirectoryCB->NameInformation.FileName,
pVolumeCB->DirectoryCB,
NULL,
- pVolumeCB->DirectoryCB->OpenReferenceCount);
+ lCount = pVolumeCB->DirectoryCB->OpenReferenceCount);
//
// Pass back the parent being the volume root
//
*ParentDirectoryCB = pVolumeCB->DirectoryCB;
- }
-
- //
- // We only need the volume shared at this point
- //
-
- AFSConvertToShared( pVolumeCB->VolumeLock);
-
- //
- // Init our name array
- //
- pNameArray = AFSInitNameArray( pVolumeCB->DirectoryCB,
- 0);
-
- if( pNameArray == NULL)
- {
-
- AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
- AFS_TRACE_LEVEL_VERBOSE,
- "AFSParseName (%08lX) Failed to initialize name array\n",
- Irp);
-
- AFSReleaseResource( pVolumeCB->VolumeLock);
-
- try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
}
//
// Increment our reference on the volume
//
- InterlockedIncrement( &pVolumeCB->VolumeReferenceCount);
+ lCount = InterlockedIncrement( &pVolumeCB->VolumeReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_VOLUME_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
"AFSParseName Increment2 count on global volume %08lX Cnt %d\n",
pVolumeCB,
- pVolumeCB->VolumeReferenceCount);
+ lCount);
try_exit:
if( *VolumeCB != NULL)
{
-
ASSERT( (*VolumeCB)->VolumeReferenceCount > 1);
}
NTSTATUS ntStatus = STATUS_SUCCESS;
UNICODE_STRING uniName;
- AFSFileID stFileID;
AFSDirEnumEntry *pDirEnumEntry = NULL;
AFSDeviceExt *pDevExt = (AFSDeviceExt *)AFSRDRDeviceObject->DeviceExtension;
AFSDirHdr *pDirHdr = &AFSGlobalRoot->ObjectInformation.Specific.Directory.DirectoryNodeHdr;
AFSDirectoryCB *pDirNode = NULL;
UNICODE_STRING uniDirName, uniTargetName;
AFSVolumeCB *pVolumeCB = NULL;
+ LONG lCount;
__Enter
{
// OK, ask the CM about this component name
//
- stFileID = AFSGlobalRoot->ObjectInformation.FileId;
-
ntStatus = AFSEvaluateTargetByName( AuthGroup,
- &stFileID,
+ &AFSGlobalRoot->ObjectInformation,
CellName,
&pDirEnumEntry);
if( !NT_SUCCESS( ntStatus))
{
+ AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
+ AFS_TRACE_LEVEL_WARNING,
+ "AFSCheckCellName entry %wZ does not exist parent FID %08lX-%08lX-%08lX-%08lX Status %08lX\n",
+ CellName,
+ AFSGlobalRoot->ObjectInformation.FileId.Cell,
+ AFSGlobalRoot->ObjectInformation.FileId.Volume,
+ AFSGlobalRoot->ObjectInformation.FileId.Vnode,
+ AFSGlobalRoot->ObjectInformation.FileId.Unique,
+ ntStatus);
+
try_return( ntStatus);
}
{
//
- // We have the global root on entry so drop it now
- //
-
- AFSReleaseResource( AFSGlobalRoot->VolumeLock);
-
- //
// Build the root volume entry
//
if( !NT_SUCCESS( ntStatus))
{
-
- //
- // On failure this routine is expecting to hold the global root
- //
-
- AFSAcquireShared( AFSGlobalRoot->VolumeLock,
- TRUE);
-
try_return( ntStatus);
}
*ShareDirEntry = pVolumeCB->DirectoryCB;
- InterlockedIncrement( &pVolumeCB->DirectoryCB->OpenReferenceCount);
+ lCount = InterlockedIncrement( &pVolumeCB->DirectoryCB->OpenReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
&pVolumeCB->DirectoryCB->NameInformation.FileName,
pVolumeCB->DirectoryCB,
NULL,
- pVolumeCB->DirectoryCB->OpenReferenceCount);
+ lCount);
- InterlockedDecrement( &pVolumeCB->VolumeReferenceCount);
+ lCount = InterlockedDecrement( &pVolumeCB->VolumeReferenceCount);
}
else
{
+ lCount = InterlockedIncrement( &pDirHdr->ContentIndex);
+
pDirNode = AFSInitDirEntry( &AFSGlobalRoot->ObjectInformation,
&uniDirName,
&uniTargetName,
pDirEnumEntry,
- (ULONG)InterlockedIncrement( &pDirHdr->ContentIndex));
+ (ULONG)lCount);
if( pDirNode == NULL)
{
SetFlag( pDirNode->Flags, AFS_DIR_ENTRY_INSERTED_ENUM_LIST);
- InterlockedIncrement( &AFSGlobalRoot->ObjectInformation.Specific.Directory.DirectoryNodeCount);
+ lCount = InterlockedIncrement( &AFSGlobalRoot->ObjectInformation.Specific.Directory.DirectoryNodeCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_DIR_NODE_COUNT,
AFS_TRACE_LEVEL_VERBOSE,
"AFSCheckCellName Adding entry %wZ Inc Count %d to parent FID %08lX-%08lX-%08lX-%08lX\n",
- &pDirNode->NameInformation.FileName,
- AFSGlobalRoot->ObjectInformation.Specific.Directory.DirectoryNodeCount,
- AFSGlobalRoot->ObjectInformation.FileId.Cell,
- AFSGlobalRoot->ObjectInformation.FileId.Volume,
- AFSGlobalRoot->ObjectInformation.FileId.Vnode,
- AFSGlobalRoot->ObjectInformation.FileId.Unique);
+ &pDirNode->NameInformation.FileName,
+ lCount,
+ AFSGlobalRoot->ObjectInformation.FileId.Cell,
+ AFSGlobalRoot->ObjectInformation.FileId.Volume,
+ AFSGlobalRoot->ObjectInformation.FileId.Vnode,
+ AFSGlobalRoot->ObjectInformation.FileId.Unique);
- InterlockedIncrement( &pDirNode->OpenReferenceCount);
+ lCount = InterlockedIncrement( &pDirNode->OpenReferenceCount);
AFSDbgLogMsg( AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
&pDirNode->NameInformation.FileName,
pDirNode,
NULL,
- pDirNode->OpenReferenceCount);
+ lCount);
AFSReleaseResource( AFSGlobalRoot->ObjectInformation.Specific.Directory.DirectoryNodeHdr.TreeLock);
ULONGLONG ullIndex = 0;
AFSVolumeCB *pVolumeCB = NULL;
AFSFileID stTargetFileID;
+ LONG lCount;
__Enter
{
DirectoryCB->ObjectInformation->FileId.Vnode,
DirectoryCB->ObjectInformation->FileId.Unique);
- try_return( ntStatus = STATUS_ACCESS_DENIED);
+ try_return( ntStatus = STATUS_REPARSE_POINT_NOT_RESOLVED);
}
AFSAcquireExcl( &DirectoryCB->NonPaged->Lock,
// deadlock with invalidation
//
- InterlockedIncrement( &pVolumeCB->VolumeReferenceCount);
+ lCount = InterlockedIncrement( &pVolumeCB->VolumeReferenceCount);
AFSReleaseResource( &pDevExt->Specific.RDR.VolumeTreeLock);
AFSAcquireExcl( pVolumeCB->VolumeLock,
TRUE);
- InterlockedDecrement( &pVolumeCB->VolumeReferenceCount);
+ lCount = InterlockedDecrement( &pVolumeCB->VolumeReferenceCount);
}
if( pVolumeCB->RootFcb == NULL)
AFSReleaseResource( &pVolumeCB->RootFcb->NPFcb->Resource);
}
- AFSConvertToShared( pVolumeCB->VolumeLock);
-
AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
AFS_TRACE_LEVEL_VERBOSE_2,
"AFSBuildMountPointTarget Evaluated target of %wZ FID %08lX-%08lX-%08lX-%08lX as root volume\n",
pVolumeCB->ObjectInformation.FileId.Vnode,
pVolumeCB->ObjectInformation.FileId.Unique);
- InterlockedIncrement( &pVolumeCB->VolumeReferenceCount);
+ lCount = InterlockedIncrement( &pVolumeCB->VolumeReferenceCount);
+
+ AFSReleaseResource( pVolumeCB->VolumeLock);
AFSDbgLogMsg( AFS_SUBSYSTEM_VOLUME_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
"AFSBuildMountPointTarget Increment count on volume %08lX Cnt %d\n",
pVolumeCB,
- pVolumeCB->VolumeReferenceCount);
+ lCount);
*TargetVolumeCB = pVolumeCB;
UNICODE_STRING uniDirName, uniTargetName;
ULONGLONG ullIndex = 0;
AFSVolumeCB *pVolumeCB = NULL;
+ LONG lCount;
__Enter
{
// deadlock with invalidation
//
- InterlockedIncrement( &pVolumeCB->VolumeReferenceCount);
+ lCount = InterlockedIncrement( &pVolumeCB->VolumeReferenceCount);
AFSReleaseResource( &pDevExt->Specific.RDR.VolumeTreeLock);
AFSAcquireExcl( pVolumeCB->VolumeLock,
TRUE);
- InterlockedDecrement( &pVolumeCB->VolumeReferenceCount);
+ lCount = InterlockedDecrement( &pVolumeCB->VolumeReferenceCount);
}
AFSReleaseResource( &pVolumeCB->RootFcb->NPFcb->Resource);
}
- AFSConvertToShared( pVolumeCB->VolumeLock);
-
AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
AFS_TRACE_LEVEL_VERBOSE_2,
"AFSBuildRootVolume Evaluated target of %wZ FID %08lX-%08lX-%08lX-%08lX as root volume\n",
pVolumeCB->ObjectInformation.FileId.Vnode,
pVolumeCB->ObjectInformation.FileId.Unique);
- InterlockedIncrement( &pVolumeCB->VolumeReferenceCount);
+ lCount = InterlockedIncrement( &pVolumeCB->VolumeReferenceCount);
+
+ AFSReleaseResource( pVolumeCB->VolumeLock);
AFSDbgLogMsg( AFS_SUBSYSTEM_VOLUME_REF_COUNTING,
AFS_TRACE_LEVEL_VERBOSE,
"AFSBuildRootVolume Increment count on volume %08lX Cnt %d\n",
pVolumeCB,
- pVolumeCB->VolumeReferenceCount);
+ lCount);
*TargetVolumeCB = pVolumeCB;
if( NT_SUCCESS( ntStatus))
{
- ntStatus = STATUS_ACCESS_DENIED;
+ ntStatus = STATUS_REPARSE_POINT_NOT_RESOLVED;
}
try_return( ntStatus);