From nobody Thu Dec 18 14:53:03 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 AB0B8C4332F for ; Tue, 12 Dec 2023 14:47:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376953AbjLLOrO (ORCPT ); Tue, 12 Dec 2023 09:47:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376946AbjLLOq4 (ORCPT ); Tue, 12 Dec 2023 09:46:56 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC1F81BDA for ; Tue, 12 Dec 2023 06:46:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702392383; 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=isSXcxvge/ydM+xPKbI/T9XnOq/fMBavCgLvhH2X3u2E+VJHUvvoUNFyoOldi6wN9VaHkR TCbozbWgG7UrFQP01edUYQDhpivw7Ljn3l6ZEjwvNKHKl1voAvpDXQ4lDE0nXvZOjhRmd1 oiFoK0RlCHYZpFOLga+iTgmpKXZAAO0= 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-171-NdCldNcMPbqpk2HVg85BjA-1; Tue, 12 Dec 2023 09:46:17 -0500 X-MC-Unique: NdCldNcMPbqpk2HVg85BjA-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 2738A88F2EB; Tue, 12 Dec 2023 14:46:17 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2506C492BE6; Tue, 12 Dec 2023 14:46:16 +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 v3 1/3] afs: Fix the dynamic root's d_delete to always delete unused dentries Date: Tue, 12 Dec 2023 14:46:09 +0000 Message-ID: <20231212144611.3100234-2-dhowells@redhat.com> In-Reply-To: <20231212144611.3100234-1-dhowells@redhat.com> References: <20231212144611.3100234-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, };