summaryrefslogtreecommitdiff
path: root/fs/cifs/transport.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2006-07-14 22:37:11 +0000
committerSteve French <sfrench@us.ibm.com>2006-08-11 21:27:07 +0000
commit3a5ff61c18659443f76bad6cf06f60103046de5d (patch)
tree541e341724b50b11c598c9790370d460f189586b /fs/cifs/transport.c
parent9f737633e6ee54fc174282d49b2559bd2208391d (diff)
[CIFS] Do not time out posix brl requests when using new posix setfileinfo
request and do not time out slow requests to a server that is still responding well to other threads Suggested by jra of Samba team Signed-off-by: Steve French <sfrench@us.ibm.com> (cherry picked from 89b57148115479eef074b8d3f86c4c86c96ac969 commit)
Diffstat (limited to 'fs/cifs/transport.c')
-rw-r--r--fs/cifs/transport.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index 17ba329e2b3d..95e23ca670a8 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -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 {