]> err.no Git - linux-2.6/blobdiff - fs/cifs/transport.c
[CIFS] Do not time out posix brl requests when using new posix setfileinfo
[linux-2.6] / fs / cifs / transport.c
index 17ba329e2b3de5cbf02b973cf0b3a04515736b43..95e23ca670a8002ab3656cbc46423051d05ffbf2 100644 (file)
@@ -444,8 +444,9 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
        if(timeout != MAX_SCHEDULE_TIMEOUT) {
                timeout += jiffies;
                wait_event(ses->server->response_q,
-                       (!(midQ->midState & MID_REQUEST_SUBMITTED)) || 
-                       time_after(jiffies, timeout) || 
+                       (!(midQ->midState & MID_REQUEST_SUBMITTED)) ||
+                       (time_after(jiffies, timeout) &&
+                               time_after(jiffies, ses->server->lstrp + HZ)) ||
                        ((ses->server->tcpStatus != CifsGood) &&
                         (ses->server->tcpStatus != CifsNew)));
        } else {
@@ -710,9 +711,18 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
        /* No user interrupts in wait - wreaks havoc with performance */
        if(timeout != MAX_SCHEDULE_TIMEOUT) {
                timeout += jiffies;
+               /* although we prefer not to time out if the server is still
+               responding - we will time out if the server takes
+               more than 15 (or 45 or 180) seconds to respond to this request
+               and has not responded to any request from other threads
+               on this client within a second (note that it is not worth
+               grabbing the GlobalMid_Lock and slowing things down in this
+               wait event to more accurately check the lstrsp field on some 
+               arch since we are already in an error path that will retry */
                wait_event(ses->server->response_q,
                        (!(midQ->midState & MID_REQUEST_SUBMITTED)) || 
-                       time_after(jiffies, timeout) || 
+                       (time_after(jiffies, timeout) &&
+                               time_after(jiffies, ses->server->lstrp + HZ)) ||
                        ((ses->server->tcpStatus != CifsGood) &&
                         (ses->server->tcpStatus != CifsNew)));
        } else {