diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-05-13 12:51:03 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-05-14 15:09:34 -0400 |
commit | d300a41ef1c39cc5e6b90fd8834ea7ab16b5c48f (patch) | |
tree | 2d439ac7e0a95329daf686ea27ba0cea35acb301 /net/sunrpc/auth.c | |
parent | 93870d76fee22e887aa6e7e1fc904dbeca976928 (diff) |
SUNRPC: Dont run rpcauth_cache_shrinker() when gfp_mask is GFP_NOFS
Under some circumstances, put_rpccred() can end up allocating memory, so
check the gfp_mask to prevent deadlocks.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/auth.c')
-rw-r--r-- | net/sunrpc/auth.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index 95afe79dd9d7..0667a36aee78 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c | |||
@@ -270,6 +270,8 @@ rpcauth_cache_shrinker(int nr_to_scan, gfp_t gfp_mask) | |||
270 | LIST_HEAD(free); | 270 | LIST_HEAD(free); |
271 | int res; | 271 | int res; |
272 | 272 | ||
273 | if ((gfp_mask & GFP_KERNEL) != GFP_KERNEL) | ||
274 | return (nr_to_scan == 0) ? 0 : -1; | ||
273 | if (list_empty(&cred_unused)) | 275 | if (list_empty(&cred_unused)) |
274 | return 0; | 276 | return 0; |
275 | spin_lock(&rpc_credcache_lock); | 277 | spin_lock(&rpc_credcache_lock); |