Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3371230rdb; Thu, 16 Nov 2023 07:53:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IHrburSUuBkLlavrbTpKIrr/lOpJfRKT3BPWpbe+0x/3ap8qQlwoGesyB4xHp3+UFf5ul6i X-Received: by 2002:a17:90a:34b:b0:27d:880d:8645 with SMTP id 11-20020a17090a034b00b0027d880d8645mr13160952pjf.49.1700150021043; Thu, 16 Nov 2023 07:53:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700150021; cv=none; d=google.com; s=arc-20160816; b=XQcas7YyGjY6OHli2hd3dYPHLLTDebnLfYtmlTgFwJ5G51pHEO4da59FZeLxYNE8A2 w349Dd9DUncwho1cxv7zZJPkFS4WisLnPktFYjNi0NoHVJdrwdo3dtTFKBPOA8Tk1fgz 6MtfM5fGgxhLzLwdrBUKkOYpIMB6IKXUHY9DigmjJCgnyACfkNq2ZFkmqIV+Ycu4+YZ1 TcS2+SyoJOsY3bQApd5gjbt12GbYp9LQzsHDK1bQQL1EZaHBFrReR7siFGIep6IUUIef DQ2RTbM37uRT5DtbPit6jGNaxxmHZpddc345P8oWjDtRO0xiq0+828okHm7wZDcriha9 7o/Q== 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=hhGgF4sumcSjliim6dBu5rLnVa3iX5fUGEGQb8mJ0/o=; fh=rWk29oQlptufvXMyjz5YsQs/d9Zzz9HZnEdbG7o8u50=; b=moW+aAxcxaQrFhaOrV0iZrmMZUuylSHQr0Yxd3TF6QmJhnlqge+8AF30nG/HWXzM/W wlS9ZA+yAxSmS0beTIj7saw3yK2U25BQ80O6XcU9zu/Ir0NH+8ksYIJ9m19o+MDUiese Yqx5f+bqPIdJDLHeE3ZeImdUiqu/DQlGrPt68ecZWNLjX18RU8fGuEG5djJrtNsqaHdO jN6jf8HFK5ej774XevstIiesFYcLe0pCzL2dXmwazusIkY1lo1ZhfrP40Q3bTMYMsC8c 9XV3AGCrYcKKQJOOcTgYxP7wYnPXAqoxiaYZjvikTviRaGsn9jmllR0cKKDmbEbCD+gS iC7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=T6kK9Rxf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id j4-20020a17090a31c400b00281052010a0si2321740pjf.40.2023.11.16.07.53.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 07:53:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=T6kK9Rxf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id D4FC181D773F; Thu, 16 Nov 2023 07:53:39 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345448AbjKPPxd (ORCPT + 99 others); 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: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,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 lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Thu, 16 Nov 2023 07:53:39 -0800 (PST) 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=216637 Signed-off-by: David Howells Reviewed-by: Jeffrey Altman cc: Marc Dionne cc: linux-afs@lists.infradead.org --- 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) ret = dns_query(net->net, "afsdb", name, len, "srv=1", NULL, NULL, false); - if (ret == -ENODATA) - ret = -EDESTADDRREQ; + if (ret == -ENODATA || ret == -ENOKEY) + ret = -ENOENT; return ret; }