Commit 65a56d6d authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] call svc_sock_setbufsize when socket created.

bufsiz is re-evaluated on recv if SK_CHNGBUF is set,
but recv will never be reached if the buffers are too small.
So we have to set to to something vaguely reasonable
at init time.
parent df0afc51
......@@ -574,6 +574,14 @@ svc_udp_init(struct svc_sock *svsk)
svsk->sk_recvfrom = svc_udp_recvfrom;
svsk->sk_sendto = svc_udp_sendto;
/* initialise setting must have enough space to
* receive and respond to one request.
* svc_udp_recvfrom will re-adjust if necessary
*/
svc_sock_setbufsize(svsk->sk_sock,
3 * svsk->sk_server->sv_bufsz,
3 * svsk->sk_server->sv_bufsz);
set_bit(SK_CHNGBUF, &svsk->sk_flags);
return 0;
......@@ -946,6 +954,14 @@ svc_tcp_init(struct svc_sock *svsk)
svsk->sk_reclen = 0;
svsk->sk_tcplen = 0;
/* initialise setting must have enough space to
* receive and respond to one request.
* svc_tcp_recvfrom will re-adjust if necessary
*/
svc_sock_setbufsize(svsk->sk_sock,
3 * svsk->sk_server->sv_bufsz,
3 * svsk->sk_server->sv_bufsz);
set_bit(SK_CHNGBUF, &svsk->sk_flags);
}
......
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