Windows: clear pending delete upon deletion
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 18 Oct 2012 13:56:12 +0000 (09:56 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 19 Oct 2012 14:19:22 +0000 (07:19 -0700)
During cleanup processing if the DELETE_PENDING flag is set
the service will be told to delete the file when the handle
count reaches 1.  At that point the file will be deleted
and the DELETED flag will be set on the object info object.
The DELETE_PENDING flag was not being cleared which could
lead to confusion.  This patchset clears the flag after deletion.

Change-Id: Ib30bb3a5c3a06b8971ac4523e6eacefaaed068ce
Reviewed-on: http://gerrit.openafs.org/8253
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

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

index d8a7081..0130c3d 100644 (file)
@@ -462,6 +462,8 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
 
                         SetFlag( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_DELETED);
 
+                        ClearFlag( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_PENDING_DELETE);
+
                         pParentObjectInfo = pObjectInfo->ParentObjectInformation;
 
                         ASSERT( pParentObjectInfo != NULL);
@@ -818,6 +820,8 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
 
                         SetFlag( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_DELETED);
 
+                        ClearFlag( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_PENDING_DELETE);
+
                         pParentObjectInfo = pObjectInfo->ParentObjectInformation;
 
                         ASSERT( pParentObjectInfo != NULL);
@@ -1126,6 +1130,8 @@ AFSCleanup( IN PDEVICE_OBJECT LibDeviceObject,
 
                         SetFlag( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_DELETED);
 
+                        ClearFlag( pCcb->DirectoryCB->Flags, AFS_DIR_ENTRY_PENDING_DELETE);
+
                         pParentObjectInfo = pObjectInfo->ParentObjectInformation;
 
                         ASSERT( pParentObjectInfo != NULL);