Commit 2a974680 authored by Petr Tesarik's avatar Petr Tesarik Committed by Steve French

[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: default avatarPetr Tesarik <ptesarik@suse.cz>
Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent f7a44ead
...@@ -438,9 +438,9 @@ incomplete_rcv: ...@@ -438,9 +438,9 @@ incomplete_rcv:
csocket = server->ssocket; csocket = server->ssocket;
wake_up(&server->response_q); wake_up(&server->response_q);
continue; continue;
} else if (length < 4) { } else if (length < pdu_length) {
cFYI(1, ("less than four bytes received (%d bytes)", cFYI(1, ("requested %d bytes but only got %d bytes",
length)); pdu_length, length));
pdu_length -= length; pdu_length -= length;
msleep(1); msleep(1);
goto incomplete_rcv; goto incomplete_rcv;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment