Skip to content

Commit

Permalink
SUNRPC: Dont run rpcauth_cache_shrinker() when gfp_mask is GFP_NOFS
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed May 14, 2010
1 parent 93870d7 commit d300a41
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/sunrpc/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ rpcauth_cache_shrinker(int nr_to_scan, gfp_t gfp_mask)
LIST_HEAD(free);
int res;

if ((gfp_mask & GFP_KERNEL) != GFP_KERNEL)
return (nr_to_scan == 0) ? 0 : -1;
if (list_empty(&cred_unused))
return 0;
spin_lock(&rpc_credcache_lock);
Expand Down

0 comments on commit d300a41

Please sign in to comment.