Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp161245rdb; Thu, 21 Dec 2023 05:56:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+brqUpcsjdBDy0ducPfeb1hFIZ9M+4U9vECiiBKAW9fn95Eq3h8Lt7aS9i2OCzyKM7BFo X-Received: by 2002:a17:906:3295:b0:a23:7490:63be with SMTP id 21-20020a170906329500b00a23749063bemr1915634ejw.32.1703166978264; Thu, 21 Dec 2023 05:56:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703166978; cv=none; d=google.com; s=arc-20160816; b=uYOVT/W5V9YIUyAU0aGd3ibopXv4CO/o76IQKt+ddzQL3co7n8p64X9MPuPMNK6Sdq SG3PC0fxkjR1shWVadnMep3mcC/s9P7S+6NvdWNqg5zZ6SvjE/d+nsBjE+8raYr+q+Gs etaWrRVPRD3aN0AiWUA1MRuu1S/+ae3Wxdv9TQLMBg+dFyWYdzmVSK5x4dVM9uIBV018 2F3rvQdh19ndM+2JFplPp1WXMhIID4Pl8bna6SE1D3aPOIJsw4L6o8lzI+04iv2kpRqZ r0TI4ZXWglCY+XbehOXB1zwYmnwD13IbNv3HgJhm2Dga2ZxTzKIun3oAw4ANcAheJrtu rwxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=FhlF0RFlx/kyh10s4ogQ+OUEod4X/F6PSmoh9V7F5AY=; fh=amlZE/0bmUZb0iruJSnjcNGDWpcpLgWng4o3VdOIeS8=; b=oV4ocsOaF2zqrcM7x7tbWfw0lETXoxFuVD+gH0g1aYfU9/5gQFnzcGAtujDAFxwpwu jaFlB/ffmgSBgQ/1XqUWp1MeY1Fo3gRAROhDXHCWre1800Kbjk7X17Ty8LtBBJowhiZI wM5Jh/Yu54gVzYh6LXtt8p9u2kki0sIboXGYDr1JZpuyDSJT5Tgm3197UesG85L4JQtJ n2sSNxfjy0ZYkTd5ybdZNQnKtIx2ygUen4Q9pslJhpv0MmiZJKhUrD+/S0TEPv8H7hRA Heck4d8ZmllPKZ4Caka7RysD2tXCE3OUGrfrlGE/cq/p/fqbdJb06mgwn7zRmAStFOa7 eBgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ftux7bAQ; spf=pass (google.com: domain of linux-kernel+bounces-8517-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8517-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id k16-20020a17090627d000b00a232d098144si871474ejc.675.2023.12.21.05.56.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 05:56:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8517-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ftux7bAQ; spf=pass (google.com: domain of linux-kernel+bounces-8517-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8517-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 09E721F21431 for ; Thu, 21 Dec 2023 13:56:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D3B255E7C; Thu, 21 Dec 2023 13:46:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ftux7bAQ" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0918A55E55 for ; Thu, 21 Dec 2023 13:46:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1703166368; 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=FhlF0RFlx/kyh10s4ogQ+OUEod4X/F6PSmoh9V7F5AY=; b=ftux7bAQRd/hfRHhu0/Erm5b2IkYePXzykeabdfIA5G579xcVfeGL5il/nqlaPG77YHHtV nWvAWWSTREQ7xkjoRZu5Vkpha1ecRtsNoZrOk2QX2Ouedz88ZWgofNq1V7xtLPlv56wfm6 /u6kCf3gr/HLsTHXVfhcpVA+B70uJnQ= 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-556-fg1EOsahPoyamTCawUubBg-1; Thu, 21 Dec 2023 08:46:03 -0500 X-MC-Unique: fg1EOsahPoyamTCawUubBg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (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 327F685A588; Thu, 21 Dec 2023 13:46:03 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.39.195.169]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1DA921C060AF; Thu, 21 Dec 2023 13:46:02 +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 v4 1/3] afs: Fix the dynamic root's d_delete to always delete unused dentries Date: Thu, 21 Dec 2023 13:45:28 +0000 Message-ID: <20231221134558.1659214-2-dhowells@redhat.com> In-Reply-To: <20231221134558.1659214-1-dhowells@redhat.com> References: <20231221134558.1659214-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 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 Tested-by: Markus Suvanto 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, };