]> www.infradead.org Git - users/jedix/linux-maple.git/commit
sunrpc: if we're closing down a socket, clear memalloc on it first
authorJeff Layton <jlayton@poochiereds.net>
Tue, 25 Aug 2015 18:28:09 +0000 (12:28 -0600)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 31 Aug 2015 20:45:54 +0000 (14:45 -0600)
commit86171c2529eb51497d06620015d269ae55f39e81
treeb0c9fa95353e6e79717283a26e53a52a1c53db67
parentc35981bd3e3df0fe550e1fafa41cdd0e33cb5f7f
sunrpc: if we're closing down a socket, clear memalloc on it first

[ Upstream commit 264d1df3b34804a7d440d77771020f616a573528 ]

We currently increment the memalloc_socks counter if we have a xprt that
is associated with a swapfile. That socket can be replaced however
during a reconnect event, and the memalloc_socks counter is never
decremented if that occurs.

When tearing down a xprt socket, check to see if the xprt is set up for
swapping and sk_clear_memalloc before releasing the socket if so.

Acked-by: 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