Received: by 2002:ab2:31c4:0:b0:1ef:b27b:cc29 with SMTP id d4csp967004lqf; Fri, 5 Apr 2024 07:48:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX6KhaaFpEv6KODzm53MB6+biNG4YhxKyguVCGdc8f67NgeLYRnPyzNR/WU6T72h95NSY0Wwdy0Jf+Q619+sUhiFT6C1eGEJE43ms7GLg== X-Google-Smtp-Source: AGHT+IEF5geCOcWvRwAUGqRExw5u/lU+ZHHrQ/QcChq0n0OhJpSzfi0ls8bHzibyor5PqtcNks7F X-Received: by 2002:ad4:5d41:0:b0:699:2d93:c0e4 with SMTP id jk1-20020ad45d41000000b006992d93c0e4mr1947602qvb.19.1712328483804; Fri, 05 Apr 2024 07:48:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712328483; cv=pass; d=google.com; s=arc-20160816; b=CPAOuN3mOytxr231EXsbkNZ/v3MbknqjQNMFTyMlCAn8bP2oIkA2EVqsj+Iag5nwJY DgT85icOIEwKO6LtAiDY3L0E7hsNWj//Jz9K0ipX9W0obhA3Rhky/4mlT+DCvaaofU76 XDepyU9jIvARx3aMhbjcsjbq11dTi9lrSC3kYL1XsEW+b07PpKz+uSVkI7byDNV2OyZb SKxlgIcIq5H4xYmR/pR+3fsMglrXTJP5DW4HZJ+TQXhMbRdEIu58PtWZFzAlVyAwIsw8 Q4uRkHzNnJVRoAdTvN+fDHq6a4+uDD8SEbVwdyQNXmPyq6JdtWmW5IHFFiYU0KCvt9jI 8MJg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=RvUinTSFKg7HhpH+pqN1A4DHEt9Q98Jvae0ji6pMDiU=; fh=6uKwOOp9hhvf67P5I2OeqIup87XvFjl/B+5iSBXgkxE=; b=quxtcJSDkZ0l9fKryv6Ow67ZBeX5ur5WrHvzSck+BsD+U80MEH1KlqdRK9BzJjcbOs YelWrWNWYZYvgNiuWus3edoUJdsY+Q6VCgTSf4HUsy0ClnMAS7zB+lMuCOuR8zo2lo+/ BUt2+1I4xtXCKmpxMhdCSznF9/Pu6T60/HG7ws+I7+izKdR+vm7eMLTCvLNWAhllgZ3P p3N3l/OlDErIDNbqzfUBLbXMTY4uOriKAXVz9ukmylIu4f/4vadT8AOlsc9ji/Dq0VHs 51DMzbLZhhkLL87TVOEKqjvzrYGKCFb7fmCXV1jOE8eUHI6Sz1xmVgtxDynoUZpWcRQJ zOZQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-133188-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133188-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e17-20020a056214163100b0068fe276cf6esi1861024qvw.330.2024.04.05.07.48.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 07:48:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133188-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-133188-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133188-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 768731C21593 for ; Fri, 5 Apr 2024 14:48:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B988116F293; Fri, 5 Apr 2024 14:47:58 +0000 (UTC) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (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 A323A8BEF for ; Fri, 5 Apr 2024 14:47:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712328478; cv=none; b=K5ysig7Qp3jFhqZoU0tvj8Pu7yHncZkcENpRB3mhyunwr55rP2siNUyPyM13R4kws+SAFcSStZfX08cmkGny4GLpfmatWLJYwhJXe8BaQXadW3Gr12PBb5e5R/BBiNbChk62tQiL0nMho1bIIfydXorQWuNE0qR0Dv7B+TAveU0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712328478; c=relaxed/simple; bh=51uyCF4lmzV3fozaPhMCo53TfAuaSOsEt2npaG2RIso=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WlTemxjc9EwSuEwiEFaeavpQYG693k91KKJLVlTuynA0PymLGpDvK+UXHQrzhA5tvRQxzrYqrF9bWIyRpL0scCGirlIRVZkW4+PLjDO1U5OnVmim+xKgBV83fp6aDNRvOQxbZ8D8nhh9Ap2dtQVUZAlMVV4i9n1E8N43duJFbmc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 788C668D07; Fri, 5 Apr 2024 16:47:52 +0200 (CEST) Date: Fri, 5 Apr 2024 16:47:52 +0200 From: Christoph Hellwig To: Daniel Wagner Cc: Christoph Hellwig , James Smart , Keith Busch , Sagi Grimberg , Hannes Reinecke , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Hannes Reinecke Subject: Re: [PATCH v4 3/5] nvmet: return DHCHAP status codes from nvmet_setup_auth() Message-ID: <20240405144752.GA6352@lst.de> References: <20240405062055.GC3107@lst.de> <3qh6d2fensgck2rodnbhreirfwkf7lloqwvk6gyfafu4fvgxss@jxb4b4kzu224> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3qh6d2fensgck2rodnbhreirfwkf7lloqwvk6gyfafu4fvgxss@jxb4b4kzu224> User-Agent: Mutt/1.5.17 (2007-11-01) On Fri, Apr 05, 2024 at 12:02:51PM +0200, Daniel Wagner wrote: > > > if (!host) { > > > pr_debug("host %s not found\n", ctrl->hostnqn); > > > - ret = -EPERM; > > > + ret = NVME_AUTH_DHCHAP_FAILURE_FAILED; > > > goto out_unlock; > > > > This is now returning returning random on the wire fields that aren't > > even the NVMe status codes from a function otherwise returning Linux > > errno values. I can't see how this works or is maintainable long term. > > This is the target side and we generate the on wire return code here. True. > Are you sure I should map this to errno codes and the back to NVME > status codes? Sure, this is possible but don't really think it makes > sense. No, but we should not overload the return value. Pass in the req or sq, or add a new paramter for the auth fail reason.