summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorDan Aloni <dan.aloni@vastdata.com>2022-07-04 15:56:57 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-08-25 11:18:22 +0200
commitb0e28398735854ceca3813fd5d53906563ed0633 (patch)
treee659d68e4632f910c0255d97c394c8202baaa549 /net
parent0a901c2f7fa77a4c5e3141a0680f3c73687c2a59 (diff)
downloadlinux-b0e28398735854ceca3813fd5d53906563ed0633.tar.gz
linux-b0e28398735854ceca3813fd5d53906563ed0633.tar.bz2
linux-b0e28398735854ceca3813fd5d53906563ed0633.zip
sunrpc: fix expiry of auth creds
commit f1bafa7375c01ff71fb7cb97c06caadfcfe815f3 upstream. Before this commit, with a large enough LRU of expired items (100), the loop skipped all the expired items and was entirely ineffectual in trimming the LRU list. Fixes: 95cd623250ad ('SUNRPC: Clean up the AUTH cache code') Signed-off-by: Dan Aloni <dan.aloni@vastdata.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/auth.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
index cdb05b48de44..e8fa21ad06a0 100644
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -494,7 +494,7 @@ rpcauth_prune_expired(struct list_head *free, int nr_to_scan)
* Enforce a 60 second garbage collection moratorium
* Note that the cred_unused list must be time-ordered.
*/
- if (!time_in_range(cred->cr_expire, expired, jiffies))
+ if (time_in_range(cred->cr_expire, expired, jiffies))
continue;
if (!rpcauth_unhash_cred(cred))
continue;