From: Petr Tesarik Date: Tue, 20 Nov 2007 02:24:08 +0000 (+0000) Subject: [CIFS] Fix spurious reconnect on 2nd peek from read of SMB length X-Git-Tag: v2.6.24-rc4~100^2~3 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a97468024fb5b6eccee2a67a7796485c829343a;p=linux-2.6 [CIFS] Fix spurious reconnect on 2nd peek from read of SMB length When retrying kernel_recvmsg() because of a short read, check returned length against the remaining length, not against total length. This avoids unneeded session reconnects which would otherwise occur when kernel_recvmsg() finally returns zero when asked to read zero bytes. Signed-off-by: Petr Tesarik Signed-off-by: Jeff Layton Signed-off-by: Steve French --- diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index c4b32b7f43..fd9147cdb5 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -438,9 +438,9 @@ incomplete_rcv: csocket = server->ssocket; wake_up(&server->response_q); continue; - } else if (length < 4) { - cFYI(1, ("less than four bytes received (%d bytes)", - length)); + } else if (length < pdu_length) { + cFYI(1, ("requested %d bytes but only got %d bytes", + pdu_length, length)); pdu_length -= length; msleep(1); goto incomplete_rcv;