Windows: AFS_INVALIDATE_DELETE must cancel IO
authorJeffrey Altman <jaltman@your-file-system.com>
Fri, 5 Oct 2012 02:07:40 +0000 (22:07 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 19 Oct 2012 09:42:41 +0000 (02:42 -0700)
When processing an AFS_INVALIDATE_DELETE the redirector
must cancel any outstanding extent requests on the file
prior to tearing down the extents.

This code path is triggered either when VNOVNODE is received
from a file server or when an alternate cache manager interface
(SMB) unlinks the file.

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

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

index 547ed7c..2823940 100644 (file)
@@ -8938,6 +8938,14 @@ AFSPerformObjectInvalidate( IN AFSObjectInfoCB *ObjectInfo,
                     ObjectInfo->Fcb != NULL)
                 {
 
+                    AFSAcquireExcl( &ObjectInfo->Fcb->NPFcb->Specific.File.ExtentsResource,
+                                    TRUE);
+
+                    ObjectInfo->Fcb->NPFcb->Specific.File.ExtentsRequestStatus = STATUS_FILE_DELETED;
+
+                    KeSetEvent( &ObjectInfo->Fcb->NPFcb->Specific.File.ExtentsRequestComplete,
+                                0,
+                                FALSE);
 
                     //
                     // Clear out the extents
@@ -8947,6 +8955,8 @@ AFSPerformObjectInvalidate( IN AFSObjectInfoCB *ObjectInfo,
 
                     AFSTearDownFcbExtents( ObjectInfo->Fcb,
                                            NULL);
+
+                    AFSReleaseResource( &ObjectInfo->Fcb->NPFcb->Specific.File.ExtentsResource);
                 }
 
                 break;