Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp589089lqp; Fri, 5 Apr 2024 03:03:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUOfcK0gj1CTbtjjUWedyHV0xPxnZtvFKoHpual6gK2RUk9S4royLgq+t0pnVGCHjfPZyVbfgMGVy+v+x9fSGhKv+G0ie7NG3TIFM3F+g== X-Google-Smtp-Source: AGHT+IFo/huKKAH5CMcCPtXrwfl87SPnD7Kn8u+P7toEl7l1XiHL4UXNvCA30CeHooxXfZXSH+fq X-Received: by 2002:ac2:53b8:0:b0:516:d156:8299 with SMTP id j24-20020ac253b8000000b00516d1568299mr695061lfh.43.1712311401760; Fri, 05 Apr 2024 03:03:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712311401; cv=pass; d=google.com; s=arc-20160816; b=rQEFmLDWqeKWECJJkesLvRZnBDcS3sjfOWxxulCZ0guP2sKk4C5nR46cVmmrtyka3b yRG4nVQCjCvcP47aEOEw5zur6x+QCb+TJM4lMau7pAhaAoz8VwkHF734RKRELAR5e1zo zCCc7gFcH7dVrpJBcEdfWOb8ONKbDmOQLySG4GNLZ0/RdT8pAdESqmVzkWhIZnkFRKjA YqdH/Lgt0m5DNvnJtJ+FACrTlUqMJr7VQ2qp/GbOZTU7e8+QL0kTedlTFCazWmvLbUE2 HmZlpxV3JwS4HQ4aTRUVPSeS84yG1fyldaL6ZsrhPCCHxLqm3/ULCrKcMKk88huMYnqz UvLQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=b4I42ghfcXOkBGdSK8Uc9rdIRKagw1rmExmOUhZwwtc=; fh=WizBDG+DaBsFf3fs+LeijC/0OPYxbzG0uCUBMCI8st8=; b=JExEROAccIwgd2+T3Aaq4VPBHBPAb8m5M6wJEayoajGiSd7x0He592mrIMFcmGMJup UU2/kYgvmFtQOszR2W04bmlRCIqzKnZH5XEjmBTT5E/40kLFZh4FtfZU1q6CAVr4pnGm 9fyOuhBaaVf7uxF3Lox9daFl5IZ2iRYP9UQT9UeaqTyBEuYDltOPAHrJqGKZuQ+4xO/b RXjRBrAtjR8T/55ofbczD/QQ/h5kiOjZUAbD3jaCMkGijKZiNXu2nJU2u2AcES9fcf1m 25zDhRpNBG/hieH43BZCpHtEuQRp8jDl9gcEeixxEgHJCSOi1Gl03C/+7A0E5pK/0MJf pUjg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=jF2p6xeP; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=jF2p6xeP; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-132788-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132788-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id t17-20020a50ab51000000b0056e0bad0380si560803edc.11.2024.04.05.03.03.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 03:03:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-132788-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=jF2p6xeP; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=jF2p6xeP; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-132788-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132788-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 2C16E1F230C4 for ; Fri, 5 Apr 2024 10:03:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A8244161913; Fri, 5 Apr 2024 10:02:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="jF2p6xeP"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="UoWN2418"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="jF2p6xeP"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="UoWN2418" Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21D5E161317 for ; Fri, 5 Apr 2024 10:02:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712311375; cv=none; b=dAXXIfCg29fHWGm/rt365h5kCncYEAnGuJtGFzRuQEYOhAB/NaPe5iHuH8WYs/egcQIo+pe/lQdPhA62wKiu/oq1xQPGmR5PI6JZ4ZuMq/qbpN3epsXO7qgUXnoOkQnnbXy4zi4if0a2i7YTA5T1F8iiNKM1tM+Cd0wVj43mFBc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712311375; c=relaxed/simple; bh=erdqGYeH9HMbdLyStAMRoYzSDiyJGNOgmPXYLr9Kqsc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YrUzhDzp0o0bj+xZDU+7fGO3Wbh74cTZGZEcOj5qEY4yu/srR0f/lqTfc34es7HUsGU7NCQiozWQu+AKMzP2vePP9lon33IkPTip1dUY89TVbXqtQNm213d7p5TdZd78NIpSH8PLWhm9NT+fTBnsYpmXi9Oi0AP+LztZ6Wttpn4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=jF2p6xeP; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=UoWN2418; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=jF2p6xeP; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=UoWN2418; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 3C0A721A36; Fri, 5 Apr 2024 10:02:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712311372; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=b4I42ghfcXOkBGdSK8Uc9rdIRKagw1rmExmOUhZwwtc=; b=jF2p6xePRnxeU1bSAiQ1JLDLjlGHQ6xnrrIS3w0/gAa9kKP9fmqojnk1rep5yTVNKh+U0J 3OoYObdpckTqum2cwwGk881uAjGBYCoxT3VeCnz2q6aEnIqzSzEMQ6XUgz2TrA0CnGmZIg 2SC36D3CRTyBnUTHNxqgLCwAo3LNZyQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712311372; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=b4I42ghfcXOkBGdSK8Uc9rdIRKagw1rmExmOUhZwwtc=; b=UoWN2418oYZv9t9iA2kknzm+tlWIUfVo0MQU1aHrLbTj7hssrby22tbiGmvNIuG7oflLOG jGPJQmjaHvFXlDAg== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=jF2p6xeP; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=UoWN2418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712311372; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=b4I42ghfcXOkBGdSK8Uc9rdIRKagw1rmExmOUhZwwtc=; b=jF2p6xePRnxeU1bSAiQ1JLDLjlGHQ6xnrrIS3w0/gAa9kKP9fmqojnk1rep5yTVNKh+U0J 3OoYObdpckTqum2cwwGk881uAjGBYCoxT3VeCnz2q6aEnIqzSzEMQ6XUgz2TrA0CnGmZIg 2SC36D3CRTyBnUTHNxqgLCwAo3LNZyQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712311372; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=b4I42ghfcXOkBGdSK8Uc9rdIRKagw1rmExmOUhZwwtc=; b=UoWN2418oYZv9t9iA2kknzm+tlWIUfVo0MQU1aHrLbTj7hssrby22tbiGmvNIuG7oflLOG jGPJQmjaHvFXlDAg== Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 2A614139F1; Fri, 5 Apr 2024 10:02:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap2.dmz-prg2.suse.org with ESMTPSA id GcPoCEzMD2ZyZAAAn2gu4w (envelope-from ); Fri, 05 Apr 2024 10:02:52 +0000 Date: Fri, 5 Apr 2024 12:02:51 +0200 From: Daniel Wagner To: Christoph Hellwig Cc: 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: <3qh6d2fensgck2rodnbhreirfwkf7lloqwvk6gyfafu4fvgxss@jxb4b4kzu224> References: <20240405062055.GC3107@lst.de> 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: <20240405062055.GC3107@lst.de> X-Spam-Flag: NO X-Spam-Score: -5.01 X-Rspamd-Action: no action X-Rspamd-Queue-Id: 3C0A721A36 X-Spam-Level: X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-5.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; DWL_DNSWL_LOW(-1.00)[suse.de:dkim]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; MISSING_XM_UA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCVD_TLS_ALL(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:98:from]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_SEVEN(0.00)[8]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap2.dmz-prg2.suse.org:helo,imap2.dmz-prg2.suse.org:rdns,suse.de:dkim]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+] On Fri, Apr 05, 2024 at 08:20:55AM +0200, Christoph Hellwig wrote: > > @@ -131,7 +131,6 @@ int nvmet_setup_auth(struct nvmet_ctrl *ctrl) > > int ret = 0; > > struct nvmet_host_link *p; > > struct nvmet_host *host = NULL; > > - const char *hash_name; > > > > down_read(&nvmet_config_sem); > > if (nvmet_is_disc_subsys(ctrl->subsys)) > > @@ -149,13 +148,16 @@ int nvmet_setup_auth(struct nvmet_ctrl *ctrl) > > } > > 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. 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.