Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4255100rdb; Mon, 11 Dec 2023 13:33:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+IaatwV1Ag3MqQymIJx5yNHY9y4GgcPEr+taulaK9lXrzcMthb32ITa9mWvnz9lXZKKZM X-Received: by 2002:a17:90a:73c6:b0:286:74c7:4250 with SMTP id n6-20020a17090a73c600b0028674c74250mr2398179pjk.38.1702330405636; Mon, 11 Dec 2023 13:33:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702330405; cv=none; d=google.com; s=arc-20160816; b=iCJZY99bWtXY8uJBgnA6qkgrGXVUQa5okbhj9/ltzn249+i147XoyNAXW8H5Su+O/O e4QNvIGRMDWqHrs3Au6Pb67OrwuFUd6yhv8T9ov/4Ez+o2H8E8E08nCvpJ/MM+RS8Kvi bZHe7X7Ko1jyMkS2ekUD90QVN+V/fBGPihFy9+UC8ZD8cPJrQEXDUbeGQseOq+7Y5uIK Q4pfSEY109GLM2+0UQ1D8/EPmNMTLiIsYXp7ibidk4i2DuluVJl1JoVFWW/gXfxwIBwr MlFEy6At9scpNLVLMtuXK8bfoTEOxL2emt8/fLKQ2401g8a4vZ7aRvKajrQ/my9uU1OI 3aSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8Hgc4VpHrij9wpXpDIXTA7F+eZGvk3a4sFe7hddHELc=; fh=amlZE/0bmUZb0iruJSnjcNGDWpcpLgWng4o3VdOIeS8=; b=v2F7Y8uKyTGO+gNs21Mil0f5LF05eD2N2uCnh6x7te4hrVFWB8SWB/Y6amSLAicY2H 3fjwfngdmP8K7g8c72eHxta9yjOpSGu9lD38MugNMR1DZfv7h1PYxc1PHLh8IkFoUToe 2uqtvodkHqn7GSRHHfgBZlbAMUu5K/PefP6UrNOVocKEcxvB4pLZuOrBDTSDmp46u90p TgWi+Y6D0KQdOcDlgBAIz0NPt5Q6PqzCrKi4CtNkEYJbpgGzq08OHEuzfXzEjC+dlMsI 93aE46lCAoAbgfBOk2CkoD4SwQ4T9Etr6hj40A+qkTvnDYRtdbIxwXCnvX51Fp7BcNSm zwBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ebWDEFo4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id p2-20020a17090ab90200b00286c168876asi8095174pjr.54.2023.12.11.13.33.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 13:33:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ebWDEFo4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 80006804917C; Mon, 11 Dec 2023 13:33:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345220AbjLKVci (ORCPT + 99 others); Mon, 11 Dec 2023 16:32:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229625AbjLKVch (ORCPT ); Mon, 11 Dec 2023 16:32:37 -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 1EC17D2 for ; Mon, 11 Dec 2023 13:32:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702330363; 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=ebWDEFo4jjuuNX0hUF41yKXJGE3xcPdpWOX/uLrRBGG1ab30aBzPFOVweXo2B66MvKy06G QfmHohRA3oIMOAkcw5QKcdvuEzOeG5z+5hKR5GOZ35z9Y8ndmOPObbOLiEko4Z8GsSGicN GaJYK3jKDQhq8HCD/npwFBh3ThjL4/g= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-481-xi-FoAPBMIeOxUlviMVW-w-1; Mon, 11 Dec 2023 16:32:39 -0500 X-MC-Unique: xi-FoAPBMIeOxUlviMVW-w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 90EA81C0BB47; Mon, 11 Dec 2023 21:32:38 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8FC8451E3; Mon, 11 Dec 2023 21:32:37 +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 v2 1/3] afs: Fix the dynamic root's d_delete to always delete unused dentries Date: Mon, 11 Dec 2023 21:32:31 +0000 Message-ID: <20231211213233.2793525-2-dhowells@redhat.com> In-Reply-To: <20231211213233.2793525-1-dhowells@redhat.com> References: <20231211213233.2793525-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 11 Dec 2023 13:33:22 -0800 (PST) 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 *dentry, unsigned int flags) return 1; } -/* - * Allow the VFS to enquire as to whether a dentry should be unhashed (mustn'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 = { .d_revalidate = afs_dynroot_d_revalidate, - .d_delete = afs_dynroot_d_delete, + .d_delete = always_delete_dentry, .d_release = afs_d_release, .d_automount = afs_d_automount, };