diff options
author | Pavel Shilovsky <piastry@etersoft.ru> | 2012-03-20 05:55:09 -0400 |
---|---|---|
committer | Steve French <stevef@smf-gateway.(none)> | 2012-03-20 11:17:40 -0400 |
commit | 10b9b98e41ba248a899f6175ce96ee91431b6194 (patch) | |
tree | 8734af1f3e16d1836b2ce16f848828d4ac200f5f /fs/cifs/transport.c | |
parent | ce85852b90a214cf577fc1b4f49d99fd7e98784a (diff) |
CIFS: Respect negotiated MaxMpxCount
Some servers sets this value less than 50 that was hardcoded and
we lost the connection if when we exceed this limit. Fix this by
respecting this value - not sending more than the server allows.
Cc: stable@kernel.org
Reviewed-by: Jeff Layton <jlayton@samba.org>
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <stevef@smf-gateway.(none)>
Diffstat (limited to 'fs/cifs/transport.c')
-rw-r--r-- | fs/cifs/transport.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index 0cc9584f5889..99a27cfa6cd2 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c | |||
@@ -265,12 +265,12 @@ static int wait_for_free_request(struct TCP_Server_Info *server, | |||
265 | 265 | ||
266 | spin_lock(&GlobalMid_Lock); | 266 | spin_lock(&GlobalMid_Lock); |
267 | while (1) { | 267 | while (1) { |
268 | if (atomic_read(&server->inFlight) >= cifs_max_pending) { | 268 | if (atomic_read(&server->inFlight) >= server->maxReq) { |
269 | spin_unlock(&GlobalMid_Lock); | 269 | spin_unlock(&GlobalMid_Lock); |
270 | cifs_num_waiters_inc(server); | 270 | cifs_num_waiters_inc(server); |
271 | wait_event(server->request_q, | 271 | wait_event(server->request_q, |
272 | atomic_read(&server->inFlight) | 272 | atomic_read(&server->inFlight) |
273 | < cifs_max_pending); | 273 | < server->maxReq); |
274 | cifs_num_waiters_dec(server); | 274 | cifs_num_waiters_dec(server); |
275 | spin_lock(&GlobalMid_Lock); | 275 | spin_lock(&GlobalMid_Lock); |
276 | } else { | 276 | } else { |