On Wed, Jan 6, 2016 at 11:49 AM, Eric Dumazet <edumazet@xxxxxxxxxx> wrote: > Hi Trond, sorry for the mess :( No problem. It did force me to look again at that part of the code; it turns out most of the stuff we were open coding is now handled in the socket code itself. > On Wed, Jan 6, 2016 at 11:38 AM, Trond Myklebust > <trond.myklebust@xxxxxxxxxxxxxxx> wrote: >> We're seeing hangs in the NFS client code, with loops of the form: >> >> > ... > >> static void xs_write_space(struct sock *sk) >> { >> struct socket *sock; > > It seems you no longer need this @sock variable > >> + struct socket_wq *wq; >> struct rpc_xprt *xprt; >> >> if (unlikely(!(sock = sk->sk_socket))) > > if (!sk->sk_socket) > return; Fixed... Thanks! > > Maybe you don't even need to test sk_socket, but probably better not > leave it for this fix. Yes. I'll look again at future cleanups. For now, I just want to get 4.4 working again. >> @@ -1618,10 +1608,14 @@ static void xs_write_space(struct sock *sk) >> >> if (unlikely(!(xprt = xprt_from_sock(sk)))) >> return; >> - if (test_and_clear_bit(SOCKWQ_ASYNC_NOSPACE, &sock->flags) == 0) >> - return; >> + rcu_read_lock(); >> + wq = rcu_dereference(sk->sk_wq); >> + if (!wq || test_and_clear_bit(SOCKWQ_ASYNC_NOSPACE, &wq->flags) == 0) >> + goto out; >> >> xprt_write_space(xprt); >> +out: >> + rcu_read_unlock(); >> Thanks for the review! -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html