sunrpc: lock xprt before trying to set memalloc on the sockets
authorJeff Layton <jlayton@poochiereds.net>
Wed, 3 Jun 2015 20:14:28 +0000 (16:14 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Wed, 10 Jun 2015 22:26:24 +0000 (18:26 -0400)
commitd6e971d8ecafee18ff9cc1ac646eb0817ab8b143
treed1a2a975cee7cbe10258081e2a2a781a95d15a8f
parent264d1df3b34804a7d440d77771020f616a573528
sunrpc: lock xprt before trying to set memalloc on the sockets

It's possible that we could race with a call to xs_reset_transport, in
which case the xprt->inet pointer could be zeroed out while we're
accessing it. Lock the xprt before we try to set memalloc on it.

Cc: Mel Gorman <mgorman@suse.de>
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
net/sunrpc/xprtsock.c