提交 2a974680 编写于 作者: P Petr Tesarik 提交者: 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: NPetr Tesarik <ptesarik@suse.cz>
Signed-off-by: NJeff Layton <jlayton@redhat.com>
Signed-off-by: NSteve French <sfrench@us.ibm.com>
上级 f7a44ead
......@@ -438,9 +438,9 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册