Windows: Initialize Irp->IoStatus.Information earlier
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 18 Feb 2013 15:34:59 +0000 (10:34 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 22 Feb 2013 21:11:51 +0000 (13:11 -0800)
Initialize Irp->IoStatus.Information to zero immediately upon
beginning processing of the IRP in the write path.

Change-Id: I8d5a717ae8cd3bc44c2a9a65b34fd0549862d293
Reviewed-on: http://gerrit.openafs.org/9128
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

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

index 05bf857..500c3c7 100644 (file)
@@ -123,6 +123,8 @@ AFSCommonWrite( IN PDEVICE_OBJECT DeviceObject,
     __Enter
     {
 
+        Irp->IoStatus.Information = 0;
+
         pFileObject = pIrpSp->FileObject;
 
         //
@@ -290,8 +292,6 @@ AFSCommonWrite( IN PDEVICE_OBJECT DeviceObject,
                           "AFSCommonWrite (%p) Failing request due to INVALID fcb\n",
                           Irp);
 
-            Irp->IoStatus.Information = 0;
-
             try_return( ntStatus = STATUS_FILE_DELETED);
         }
 
@@ -755,6 +755,8 @@ AFSIOCtlWrite( IN PDEVICE_OBJECT DeviceObject,
     __Enter
     {
 
+        Irp->IoStatus.Information = 0;
+
         RtlZeroMemory( &stIORequestCB,
                        sizeof( AFSPIOCtlIORequestCB));
 
@@ -914,7 +916,6 @@ AFSNonCachedWrite( IN PDEVICE_OBJECT DeviceObject,
 
     __Enter
     {
-        Irp->IoStatus.Information = 0;
 
         AFSDbgLogMsg( AFS_SUBSYSTEM_IO_PROCESSING,
                       AFS_TRACE_LEVEL_VERBOSE,