From nobody Thu Dec 18 22:14:32 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 4600BC4167B for ; Mon, 11 Dec 2023 16:34:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344882AbjLKQe0 (ORCPT ); Mon, 11 Dec 2023 11:34:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344868AbjLKQeV (ORCPT ); Mon, 11 Dec 2023 11:34:21 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D6898E for ; Mon, 11 Dec 2023 08:34:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702312466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8Hgc4VpHrij9wpXpDIXTA7F+eZGvk3a4sFe7hddHELc=; b=UP/HOCiPZcFGmV2irFL2fYZ3ki5G4YcW1SOdxL2EbSxNzyp03owRBxXKN2MhzuecBc+G60 HHto6QEnmVJSP9O0qrzHgWmKQXff/yA6Kgl5zJ9cMv+Buj0gyaYa1h/0dyjpnBhUAUEtSC SlkplgQZX8lwrCuwD4HvO/KYZFTfPEk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-626-7J7Zab7gN3ihCVoCmnBD7Q-1; Mon, 11 Dec 2023 11:34:20 -0500 X-MC-Unique: 7J7Zab7gN3ihCVoCmnBD7Q-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C69F1185A780; Mon, 11 Dec 2023 16:34:19 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id C3489492BE6; Mon, 11 Dec 2023 16:34:18 +0000 (UTC) From: David Howells To: Markus Suvanto , Marc Dionne Cc: David Howells , linux-afs@lists.infradead.org, keyrings@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] afs: Fix the dynamic root's d_delete to always delete unused dentries Date: Mon, 11 Dec 2023 16:34:10 +0000 Message-ID: <20231211163412.2766147-2-dhowells@redhat.com> In-Reply-To: <20231211163412.2766147-1-dhowells@redhat.com> References: <20231211163412.2766147-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Fix the afs dynamic root's d_delete function to always delete unused dentries rather than only deleting them if they're positive. With things as they stand upstream, negative dentries stemming from failed DNS lookups stick around preventing retries. Fixes: 66c7e1d319a5 ("afs: Split the dynroot stuff out and give it its own = ops tables") Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org --- fs/afs/dynroot.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/fs/afs/dynroot.c b/fs/afs/dynroot.c index 1fa8cf23bd36..34474a061654 100644 --- a/fs/afs/dynroot.c +++ b/fs/afs/dynroot.c @@ -252,20 +252,9 @@ static int afs_dynroot_d_revalidate(struct dentry *den= try, unsigned int flags) return 1; } =20 -/* - * Allow the VFS to enquire as to whether a dentry should be unhashed (mus= tn't - * sleep) - * - called from dput() when d_count is going to 0. - * - return 1 to request dentry be unhashed, 0 otherwise - */ -static int afs_dynroot_d_delete(const struct dentry *dentry) -{ - return d_really_is_positive(dentry); -} - const struct dentry_operations afs_dynroot_dentry_operations =3D { .d_revalidate =3D afs_dynroot_d_revalidate, - .d_delete =3D afs_dynroot_d_delete, + .d_delete =3D always_delete_dentry, .d_release =3D afs_d_release, .d_automount =3D afs_d_automount, };