Windows Problem with cross-directory rename
authorPeter Scott <pscott@kerneldrivers.com>
Fri, 16 Dec 2011 00:52:54 +0000 (17:52 -0700)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 17 Dec 2011 05:21:17 +0000 (21:21 -0800)
Not correctly handling cross-directory rename processing

Change-Id: I36e30a68d7755241c727868074e344beb9580c2d
Reviewed-on: http://gerrit.openafs.org/6343
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

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

index fc09be2..2b4e2cc 100644 (file)
@@ -2056,7 +2056,6 @@ AFSSetRenameInfo( IN PIRP Irp)
     ULONG ulNotificationAction = 0, ulNotifyFilter = 0;
     UNICODE_STRING uniFullTargetPath;
     BOOLEAN bCommonParent = FALSE;
-    ULONG oldFileIndex;
     BOOLEAN bReleaseVolumeLock = FALSE;
     BOOLEAN bReleaseTargetDirLock = FALSE;
     BOOLEAN bReleaseSourceDirLock = FALSE;
@@ -2325,21 +2324,6 @@ AFSSetRenameInfo( IN PIRP Irp)
                                     pSrcCcb->DirectoryCB,
                                     !bCommonParent);
 
-        oldFileIndex = pSrcCcb->DirectoryCB->FileIndex;
-
-        if( !bCommonParent)
-        {
-
-            //
-            // We always need to update the FileIndex since this entry will be put at the 'end'
-            // of the enumeraiton list. If we don't it will cause recursion ... We do this
-            // here to cover any failures which might occur below
-            //
-
-            pSrcCcb->DirectoryCB->FileIndex =
-                            (ULONG)InterlockedIncrement( &pTargetDcb->ObjectInformation->ParentObjectInformation->Specific.Directory.DirectoryNodeHdr.ContentIndex);
-        }
-
         //
         // OK, this is a simple rename. Issue the rename
         // request to the service.
@@ -2359,7 +2343,6 @@ AFSSetRenameInfo( IN PIRP Irp)
             // Attempt to re-insert the directory entry
             //
 
-            pSrcCcb->DirectoryCB->FileIndex = oldFileIndex;
             AFSInsertDirectoryNode( pSrcFcb->ObjectInformation->ParentObjectInformation,
                                     pSrcCcb->DirectoryCB,
                                     !bCommonParent);
@@ -2420,7 +2403,6 @@ AFSSetRenameInfo( IN PIRP Irp)
             // Attempt to re-insert the directory entry
             //
 
-            pSrcCcb->DirectoryCB->FileIndex = oldFileIndex;
             AFSInsertDirectoryNode( pSrcFcb->ObjectInformation->ParentObjectInformation,
                                     pSrcCcb->DirectoryCB,
                                     !bCommonParent);