diff options
Diffstat (limited to 'net/sunrpc')
-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) | |||
236 | 236 | ||
237 | list_for_each_entry_safe(cred, next, &cred_unused, cr_lru) { | 237 | list_for_each_entry_safe(cred, next, &cred_unused, cr_lru) { |
238 | 238 | ||
239 | if (nr_to_scan-- == 0) | ||
240 | break; | ||
239 | /* | 241 | /* |
240 | * Enforce a 60 second garbage collection moratorium | 242 | * Enforce a 60 second garbage collection moratorium |
241 | * Note that the cred_unused list must be time-ordered. | 243 | * 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) | |||
255 | get_rpccred(cred); | 257 | get_rpccred(cred); |
256 | list_add_tail(&cred->cr_lru, free); | 258 | list_add_tail(&cred->cr_lru, free); |
257 | rpcauth_unhash_cred_locked(cred); | 259 | rpcauth_unhash_cred_locked(cred); |
258 | nr_to_scan--; | ||
259 | } | 260 | } |
260 | spin_unlock(cache_lock); | 261 | spin_unlock(cache_lock); |
261 | if (nr_to_scan == 0) | ||
262 | break; | ||
263 | } | 262 | } |
264 | return (number_cred_unused / 100) * sysctl_vfs_cache_pressure; | 263 | return (number_cred_unused / 100) * sysctl_vfs_cache_pressure; |
265 | } | 264 | } |