From nobody Fri Sep 5 20:13:43 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF9E0C38145 for ; Tue, 23 Aug 2022 11:52:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358610AbiHWLw2 (ORCPT ); Tue, 23 Aug 2022 07:52:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358190AbiHWLtr (ORCPT ); Tue, 23 Aug 2022 07:49:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5E7C92F64; Tue, 23 Aug 2022 02:31:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 00A03B81C85; Tue, 23 Aug 2022 09:31:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 666F6C433D7; Tue, 23 Aug 2022 09:31:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661247064; bh=tw20pXa+9aPH9hPJaqwcFL8AznpKL7tAVxhOZnoPxz0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FCwfHYr0LPqXSnIH5GzSxnTDh+qXBvpnNpPkN8JekU/9isGVdPvqp4ECdQDloVsLM Gg0cE4G4ag/xblbpZlajl2DUMpJiULXQr2owDzvoCsfksIYiPe8Lxn7V/Xdu0VI2c9 RNsvDwekCf4sQMM0wwE35PPc/U+44B4JDVVWSlxE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Aloni , Trond Myklebust Subject: [PATCH 5.4 308/389] sunrpc: fix expiry of auth creds Date: Tue, 23 Aug 2022 10:26:26 +0200 Message-Id: <20220823080128.444859208@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080115.331990024@linuxfoundation.org> References: <20220823080115.331990024@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Dan Aloni 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 Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- net/sunrpc/auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c @@ -494,7 +494,7 @@ rpcauth_prune_expired(struct list_head * * 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;