From nobody Tue Dec 16 06:03:14 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 A9422C4332F for ; Thu, 9 Nov 2023 15:42:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343907AbjKIPmQ (ORCPT ); Thu, 9 Nov 2023 10:42:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343827AbjKIPmB (ORCPT ); Thu, 9 Nov 2023 10:42:01 -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 2E65F35B7 for ; Thu, 9 Nov 2023 07:40:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699544443; 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=MtMwzp5cGYFmDvtK+8DfAGMya4LsJda/H6E5L1cfs5c=; b=DtSlm0T397+UDcGEs/NpwJl5CAY2zCc7mrDT7TYVpQluYNVSp2Evbi7+LdZzQDy1TVuUkX P2AiDwAKlB1YuOO9PEWSWURf8srJyupQcn/Btz59GO4WqB/d8tXkH+UnJ8yNq+P0nlTqrd b7eK4KvvZAwOZSsL+q4539+0HjtIK4g= 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-412-AnTV_cjYNIW4RpKqNNFvlQ-1; Thu, 09 Nov 2023 10:40:40 -0500 X-MC-Unique: AnTV_cjYNIW4RpKqNNFvlQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (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 73159848B66; Thu, 9 Nov 2023 15:40:38 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8B6D3492BF6; Thu, 9 Nov 2023 15:40:37 +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 15/41] afs: Return ENOENT if no cell DNS record can be found Date: Thu, 9 Nov 2023 15:39:38 +0000 Message-ID: <20231109154004.3317227-16-dhowells@redhat.com> In-Reply-To: <20231109154004.3317227-1-dhowells@redhat.com> References: <20231109154004.3317227-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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. Reported-by: Markus Suvanto Link: https://bugzilla.kernel.org/show_bug.cgi?id=3D216637 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 af5c6cd1ed44..01c890b3d18d 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) } =20 /* Status load is ordered after lookup counter load */ + if (cell->dns_status =3D=3D DNS_LOOKUP_GOT_NOT_FOUND) { + pr_warn("No record of cell %s\n", cell->name); + vc->error =3D -ENOENT; + return false; + } + if (cell->dns_source =3D=3D DNS_RECORD_UNAVAILABLE) { vc->error =3D -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 =3D vc->cell; static int count; int i; =20 @@ -294,6 +301,9 @@ static void afs_vl_dump_edestaddrreq(const struct afs_v= l_cursor *vc) =20 rcu_read_lock(); pr_notice("EDESTADDR occurred\n"); + pr_notice("CELL: %s err=3D%d\n", cell->name, cell->error); + pr_notice("DNS: src=3D%u st=3D%u lc=3D%x\n", + cell->dns_source, cell->dns_status, cell->dns_lookup_count); pr_notice("VC: ut=3D%lx ix=3D%u ni=3D%hu fl=3D%hx err=3D%hd\n", vc->untried, vc->index, vc->nr_iterations, vc->flags, vc->error);