diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-05-13 12:51:06 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-05-14 15:09:35 -0400 |
commit | 20673406534176ead9b984a84b662928110f77b1 (patch) | |
tree | 4d3a48c79f012af1caea39cc2c8c2b1e0c132911 /net/sunrpc/auth.c | |
parent | 93a05e65c090dda9cbd79d0cf57b65c4dbd8da55 (diff) | |
download | linux-20673406534176ead9b984a84b662928110f77b1.tar.gz linux-20673406534176ead9b984a84b662928110f77b1.tar.bz2 linux-20673406534176ead9b984a84b662928110f77b1.zip |
SUNRPC: Ensure rpcauth_prune_expired() respects the nr_to_scan parameter
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/auth.c')
-rw-r--r-- | net/sunrpc/auth.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index c40856f589f0..73affb8624fa 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c @@ -236,6 +236,8 @@ rpcauth_prune_expired(struct list_head *free, int nr_to_scan) list_for_each_entry_safe(cred, next, &cred_unused, cr_lru) { + if (nr_to_scan-- == 0) + break; /* * Enforce a 60 second garbage collection moratorium * Note that the cred_unused list must be time-ordered. @@ -255,11 +257,8 @@ rpcauth_prune_expired(struct list_head *free, int nr_to_scan) get_rpccred(cred); list_add_tail(&cred->cr_lru, free); rpcauth_unhash_cred_locked(cred); - nr_to_scan--; } spin_unlock(cache_lock); - if (nr_to_scan == 0) - break; } return (number_cred_unused / 100) * sysctl_vfs_cache_pressure; } |