summaryrefslogtreecommitdiff
path: root/fs/cifs/connect.c
diff options
context:
space:
mode:
authorPetr Tesarik <ptesarik@suse.cz>2007-11-20 02:24:08 +0000
committerSteve French <sfrench@us.ibm.com>2007-11-20 02:24:08 +0000
commit2a97468024fb5b6eccee2a67a7796485c829343a (patch)
tree98675977be018528ceb6dea5a0f634d4053478a4 /fs/cifs/connect.c
parentf7a44eadd5a03b8455c7caab402ce96811c6903d (diff)
[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 <ptesarik@suse.cz> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r--fs/cifs/connect.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index c4b32b7f4355..fd9147cdb5a9 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;