]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Windows: Do not permit RDR worker threads to quit
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 18 Jun 2012 14:10:32 +0000 (10:10 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Tue, 3 Jul 2012 15:02:06 +0000 (08:02 -0700)
If the DeviceIoControl from the service's redirector worker threads
fails the thread will terminate.  This is a problem because if all
of the threads quit the afs redirector will end up deadlocking
all requests since there will be no method of delivering them to
the service.  If there is an error log it (if possible), and retry.
Hopefully it will be transient.

Change-Id: I3ce5e338e41fd71c5289fe778789f0300c0b5ecd
Reviewed-on: http://gerrit.openafs.org/7627
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/user/RDRInit.cpp

index c8310a9af0f6e6c4c6a8f9c818918d19637c6b3e..0b624963feb66df01113e27e3cc89fc5988be92b 100644 (file)
@@ -471,7 +471,7 @@ RDR_RequestWorkerThread( LPVOID lpParameter)
 
             requestBuffer->RequestFlags = pInfo->Flags;
 
-            if( !RDR_DeviceIoControl( hDevHandle,
+            if( RDR_DeviceIoControl( hDevHandle,
                                       IOCTL_AFS_PROCESS_IRP_REQUEST,
                                       (void *)requestBuffer,
                                       sizeof( AFSCommRequest),
@@ -480,21 +480,27 @@ RDR_RequestWorkerThread( LPVOID lpParameter)
                                       &bytesReturned ))
             {
 
+                WaitForSingleObject( RDR_SuspendEvent, INFINITE);
+
                 //
-                // Error condition back from driver
+                // Go process the request
                 //
 
-                break;
+                if (!Exit)
+                    RDR_ProcessRequest( requestBuffer);
             }
+            else
+            {
 
-            WaitForSingleObject( RDR_SuspendEvent, INFINITE);
-
-            //
-            // Go process the request
-            //
+                if (afsd_logp->enabled) {
+                    WCHAR wchBuffer[256];
+                    DWORD gle = GetLastError();
 
-            if (!Exit)
-                RDR_ProcessRequest( requestBuffer);
+                    swprintf( wchBuffer,
+                              L"Failed to post IOCTL_AFS_IRP_REQUEST gle 0x%x", gle);
+                    osi_Log1(afsd_logp, "%S", osi_LogSaveStringW(afsd_logp, wchBuffer));
+                }
+            }
         }
 
        free( requestBuffer);