dect
/
linux-2.6
Archived
13
0
Fork 0

[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>
This commit is contained in:
Petr Tesarik 2007-11-20 02:24:08 +00:00 committed by Steve French
parent f7a44eadd5
commit 2a97468024
1 changed files with 3 additions and 3 deletions

View File

@ -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;