Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3371477rdb; Thu, 16 Nov 2023 07:54:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IHXX+/KmGWJLIS/DKMSJY5OlA+AunJFXg1+bjOAUjUCDuR1zT0uj+CsjFyjHjZwzaNyRtGV X-Received: by 2002:a17:90b:1805:b0:282:cb42:246b with SMTP id lw5-20020a17090b180500b00282cb42246bmr15292542pjb.40.1700150049612; Thu, 16 Nov 2023 07:54:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700150049; cv=none; d=google.com; s=arc-20160816; b=nc2mbxsBuj98Zv/0ISRgbr9s6vNle+Bkalvx/vfLe2kYuusCwOkJ4EgSXbJjFvZrz8 6Fsg1RfXNqQBJGyUNZiDk8cP8RhXEJtRFOJ8x1XOHB7mefMYsyIsqbUwU2zLfUdydAtc Qg/aSb5ssx+Uh011u0BC9qxXGaOq9WfQANJ8tvFfBRsMfDwmRdL7DqoI3DagvJsbHJY8 ABMGDBZYfKqUGCqXjgItbV0rUiMZbLKxTh2Wtpm7kSK31TcLd17Zfk4HtqHl+W+JihcA TwEzvg7VEBUp7QSHZ5mikaWtlewK8q6wvruNGSZVEiBt7CKqsrJe4MULnCwNrtgLgleL gM5w== 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=YBtmW26NACg/zkvKRteyy2dwMoZgoN+rImCko2BBVsI=; fh=x3EdO5jBXneObQGNjbPw0Ma+NPqF9mIEGlVG/oRzsAU=; b=mNRcM6wwqm52KmORgxG3QcQjvLdWR5SIaVU0fjeSRMV66+afRrfu255ROJZcmtBMnm 9AIhLVJQL4zRfCbA6pyi1qLeJ/bxkkTuuYUFtRBgDKFM1d0ViGeL2Wv/ZVFjjk6E1qaK Fs4OhA0JbNawf44+Al45LTNaOyz8/pZFe6rPUUcKhNJtguqTtdK3kQRzfBU754qniYJ2 k8MBsTSjDycGHGqBR+IUXbD3bg0ccx6c7GcJKmme4loefwuMgttiaxf5pZlJmhQtIFbC Ga+h5+QXnzwszb3bEEoyurbw8a6DAh/agI+/J9SLcG5+qLtfTUGzCNQyELiysjU8kZa7 5Gqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GIzAp9Cu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id om17-20020a17090b3a9100b0027d032092d7si2320649pjb.184.2023.11.16.07.54.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 07:54:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GIzAp9Cu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 471AA817C3E8; Thu, 16 Nov 2023 07:54:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345435AbjKPPxa (ORCPT + 99 others); Thu, 16 Nov 2023 10:53:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345396AbjKPPx1 (ORCPT ); Thu, 16 Nov 2023 10:53:27 -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 21D6EA5 for ; Thu, 16 Nov 2023 07:53:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700150003; 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=YBtmW26NACg/zkvKRteyy2dwMoZgoN+rImCko2BBVsI=; b=GIzAp9CueYxXEpyYLZAK+qZhLtSH+5fGLor9Et5SssjrmLcB6euXRCYd01aVpUqO6X78XX 4hK8uQclXMskt8LcuBFdqJY/IxKtl4FInGs4fQmNowmAO89Hdmmaj4nBXfFLh9diFyHPTa nBlm1WhEogwf/74l5KfhS4Whzk0xu8s= 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-163-swb9e4RHNRiu82WXFOgmFg-1; Thu, 16 Nov 2023 10:53:21 -0500 X-MC-Unique: swb9e4RHNRiu82WXFOgmFg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 29FDB280A9C4; Thu, 16 Nov 2023 15:53:21 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 420CB1121307; Thu, 16 Nov 2023 15:53:20 +0000 (UTC) From: David Howells To: Marc Dionne Cc: David Howells , linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Markus Suvanto Subject: [PATCH 3/5] afs: Return ENOENT if no cell DNS record can be found Date: Thu, 16 Nov 2023 15:53:10 +0000 Message-ID: <20231116155312.156593-4-dhowells@redhat.com> In-Reply-To: <20231116155312.156593-1-dhowells@redhat.com> References: <20231116155312.156593-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Spam-Status: No, score=-1.0 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 16 Nov 2023 07:54:07 -0800 (PST) Make AFS return error ENOENT if no cell SRV or AFSDB DNS record (or cellservdb config file record) can be found rather than returning EDESTADDRREQ. Also add cell name lookup info to the cursor dump. Fixes: d5c32c89b208 ("afs: Fix cell DNS lookup") Reported-by: Markus Suvanto Link: https://bugzilla.kernel.org/show_bug.cgi?id=216637 Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org --- fs/afs/vl_rotate.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fs/afs/vl_rotate.c b/fs/afs/vl_rotate.c index 488e58490b16..eb415ce56360 100644 --- a/fs/afs/vl_rotate.c +++ b/fs/afs/vl_rotate.c @@ -58,6 +58,12 @@ static bool afs_start_vl_iteration(struct afs_vl_cursor *vc) } /* Status load is ordered after lookup counter load */ + if (cell->dns_status == DNS_LOOKUP_GOT_NOT_FOUND) { + pr_warn("No record of cell %s\n", cell->name); + vc->error = -ENOENT; + return false; + } + if (cell->dns_source == DNS_RECORD_UNAVAILABLE) { vc->error = -EDESTADDRREQ; return false; @@ -285,6 +291,7 @@ bool afs_select_vlserver(struct afs_vl_cursor *vc) */ static void afs_vl_dump_edestaddrreq(const struct afs_vl_cursor *vc) { + struct afs_cell *cell = vc->cell; static int count; int i; @@ -294,6 +301,9 @@ static void afs_vl_dump_edestaddrreq(const struct afs_vl_cursor *vc) rcu_read_lock(); pr_notice("EDESTADDR occurred\n"); + pr_notice("CELL: %s err=%d\n", cell->name, cell->error); + pr_notice("DNS: src=%u st=%u lc=%x\n", + cell->dns_source, cell->dns_status, cell->dns_lookup_count); pr_notice("VC: ut=%lx ix=%u ni=%hu fl=%hx err=%hd\n", vc->untried, vc->index, vc->nr_iterations, vc->flags, vc->error);