From nobody Tue Dec 30 11:40:30 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 B1A01C54FB9 for ; Thu, 16 Nov 2023 15:53:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345453AbjKPPxd (ORCPT ); Thu, 16 Nov 2023 10:53:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345418AbjKPPx3 (ORCPT ); Thu, 16 Nov 2023 10:53:29 -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 5330019B for ; Thu, 16 Nov 2023 07:53:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700150004; 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=hhGgF4sumcSjliim6dBu5rLnVa3iX5fUGEGQb8mJ0/o=; b=T6kK9RxfqbYq56EHp5M2wz7KVbobm/DK28JWHClFE6P5pnMUWLxHUPAW0G8w1ozrdw1TfA xsYtM10JaZpla3FEfGOGvjOo8LOqw7gavaxaRE/5/UbxQd1t97rAEqIT09KMa6GfaVaj4I RiBomOvVXrtrltgoXDFXJvjnrBp6K6w= 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-335-IHcKw8DrMNmlMuRkkWz2ZQ-1; Thu, 16 Nov 2023 10:53:20 -0500 X-MC-Unique: IHcKw8DrMNmlMuRkkWz2ZQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (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 912E4185A782; Thu, 16 Nov 2023 15:53:19 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8BDE47ACE; Thu, 16 Nov 2023 15:53:18 +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 , Jeffrey Altman Subject: [PATCH 2/5] afs: Make error on cell lookup failure consistent with OpenAFS Date: Thu, 16 Nov 2023 15:53:09 +0000 Message-ID: <20231116155312.156593-3-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: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" When kafs tries to look up a cell in the DNS or the local config, it will translate a lookup failure into EDESTADDRREQ whereas OpenAFS translates it into ENOENT. Applications such as West expect the latter behaviour and fail if they see the former. This can be seen by trying to mount an unknown cell: # mount -t afs %example.com:cell.root /mnt mount: /mnt: mount(2) system call failed: Destination address required. Fixes: 4d673da14533 ("afs: Support the AFS dynamic root") Reported-by: Markus Suvanto Link: https://bugzilla.kernel.org/show_bug.cgi?id=3D216637 Signed-off-by: David Howells Reviewed-by: Jeffrey Altman cc: Marc Dionne cc: linux-afs@lists.infradead.org Reviewed-by: Marc Dionne --- fs/afs/dynroot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/afs/dynroot.c b/fs/afs/dynroot.c index 4d04ef2d3ae7..1fa8cf23bd36 100644 --- a/fs/afs/dynroot.c +++ b/fs/afs/dynroot.c @@ -132,8 +132,8 @@ static int afs_probe_cell_name(struct dentry *dentry) =20 ret =3D dns_query(net->net, "afsdb", name, len, "srv=3D1", NULL, NULL, false); - if (ret =3D=3D -ENODATA) - ret =3D -EDESTADDRREQ; + if (ret =3D=3D -ENODATA || ret =3D=3D -ENOKEY) + ret =3D -ENOENT; return ret; }