Skip to content

Commit

Permalink
SUNRPC: Fix up socket polling
Browse files Browse the repository at this point in the history
Ensure that we do not exit the socket read callback without clearing
XPRT_SOCK_DATA_READY.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
  • Loading branch information
Trond Myklebust committed Dec 5, 2018
1 parent b76a5af commit dfcf038
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/sunrpc/xprtsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,9 +649,9 @@ static void xs_stream_data_receive(struct sock_xprt *transport)
ssize_t ret = 0;

mutex_lock(&transport->recv_mutex);
clear_bit(XPRT_SOCK_DATA_READY, &transport->sock_state);
if (transport->sock == NULL)
goto out;
clear_bit(XPRT_SOCK_DATA_READY, &transport->sock_state);
for (;;) {
ret = xs_read_stream(transport, MSG_DONTWAIT);
if (ret < 0)
Expand Down Expand Up @@ -1346,10 +1346,10 @@ static void xs_udp_data_receive(struct sock_xprt *transport)
int err;

mutex_lock(&transport->recv_mutex);
clear_bit(XPRT_SOCK_DATA_READY, &transport->sock_state);
sk = transport->inet;
if (sk == NULL)
goto out;
clear_bit(XPRT_SOCK_DATA_READY, &transport->sock_state);
for (;;) {
skb = skb_recv_udp(sk, 0, 1, &err);
if (skb == NULL)
Expand Down

0 comments on commit dfcf038

Please sign in to comment.