提交 76119125 编写于 作者: S Stefano Stabellini 提交者: Juergen Gross

pvcalls-back: do not return error on inet_accept EAGAIN

When the client sends a regular blocking accept request, the backend is
expected to return only when the accept is completed, simulating a
blocking behavior, or return an error.

Specifically, on EAGAIN from inet_accept, the backend shouldn't return
"EAGAIN" to the client. Instead, it should simply continue the wait.
Otherwise, the client will send another accept request, which will cause
another EAGAIN to be sent back, which is a waste of resources and not
conforming to the expected behavior. Change the behavior by turning the
"goto error" into a return.
Signed-off-by: NStefano Stabellini <stefano@aporeto.com>
Reviewed-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: NJuergen Gross <jgross@suse.com>
上级 f599c64f
...@@ -548,7 +548,7 @@ static void __pvcalls_back_accept(struct work_struct *work) ...@@ -548,7 +548,7 @@ static void __pvcalls_back_accept(struct work_struct *work)
ret = inet_accept(mappass->sock, sock, O_NONBLOCK, true); ret = inet_accept(mappass->sock, sock, O_NONBLOCK, true);
if (ret == -EAGAIN) { if (ret == -EAGAIN) {
sock_release(sock); sock_release(sock);
goto out_error; return;
} }
map = pvcalls_new_active_socket(fedata, map = pvcalls_new_active_socket(fedata,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册