Windows: AFSCommonWrite STATUS_PENDING is Success
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 9 Jan 2014 14:58:56 +0000 (09:58 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Thu, 9 Jan 2014 19:21:53 +0000 (11:21 -0800)
AFSCommonWrite() can return STATUS_PENDING if the write has been
deferred.  In that case, the function exit must not:

 * Update the Valid Data Length

 * Purge the cache

 * or do anything else related to the request

Change-Id: Ib34bef3a1d56d452babcaf1f3cfbf77fe8f93388
Reviewed-on: http://gerrit.openafs.org/10685
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

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

index 141fccd..375b101 100644 (file)
@@ -752,7 +752,8 @@ try_exit:
                       Irp,
                       ntStatus));
 
-        if ( NT_SUCCESS( ntStatus))
+       if ( NT_SUCCESS( ntStatus) &&
+            ntStatus != STATUS_PENDING)
         {
             if ( !bPagingIo)
             {
@@ -784,7 +785,8 @@ try_exit:
             }
         }
 
-        if ( !bPagingIo && bNonCachedIo && CcIsFileCached( pFileObject) &&
+       if ( ntStatus != STATUS_PENDING &&
+            !bPagingIo && bNonCachedIo && CcIsFileCached( pFileObject) &&
              pNPFcb->SectionObjectPointers.DataSectionObject != NULL &&
              bReleaseSectionObject)
         {