Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp698996lqp; Fri, 5 Apr 2024 06:28:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUWoDl6ChGCGu2ytwZw7gq+CZJy2sejTfVflOfOlvDN0YZL0RBCtzS75YlhrPSGzAbVQ+yfLzFoiBK//ADu6f4vd3sX9hPmKv5yJQf/vA== X-Google-Smtp-Source: AGHT+IE45PEcMgjaAtTENt+mngzjLcBWgM2J+7PRanhggDjMNDops9ZtaKBn6mFF2XAxjJiNydNL X-Received: by 2002:a05:6102:e0c:b0:476:f862:9a8b with SMTP id o12-20020a0561020e0c00b00476f8629a8bmr1574433vst.25.1712323531755; Fri, 05 Apr 2024 06:25:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712323531; cv=pass; d=google.com; s=arc-20160816; b=QcJcAZx3eiYtwx5zrWcv079dr0SEoA1uPJ/QsVsPwC+Z8iSDnIEM5o8S2DpzyEc2Pd 7Q4ThV2i3k7wY6Z19weO6+fvRl3JsjjULM0vP44CijKNiZSHcZx94VidMgcVGPTaVOmT kN8HD5EwyOWAZdNKSVh68TNrWbuxbpiF9oDIikUlTujkO65N9lmypf6MIebwSFuxw8vs Ssgn4P8uSF6yPyPwozf7zV9d0NnL6w30MVhslOe8FHiDRk+1OLHK4QaoyH7HM5/IF5V9 4jxqmbsP7NBUbac/qJ9ChMh1FmkJG0reTwElwGPv20E79aEK6iroHBBfP1sAwpSVLil4 OrKw== 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=PJC3Z1irT0+nnttWGlCwrHW635IJ8lN25LyXL+82QFU=; fh=WizBDG+DaBsFf3fs+LeijC/0OPYxbzG0uCUBMCI8st8=; b=ASxRi9hi55hb+zpYqExs5+MAOSIUWRd8953Wwkh5bC4by6s27qMyYjAcJ9mdtNB8bY pi37XJ2iwwi+DGBbAZknzx9TiSv4Y3tPrcZqfEGxBR3bIvPrrAJaw5mHBl9HZP7x1NLL qa0eImGPhfti7gPJu3svEohYbU2jt4l/DCm4Wcg40btwDgE2RDBigJH27XgvABFoPFNm bZBLhE+uTuMPIuvAugNc2aFtA76UqIU41StcFb4QuVq+hMz3LJJTYxF8DysVQufXPysj a4gkOQK9faV74y9aInn3N2593t2VI+BzB6rXizaC4eO5c2QBK5QSe99FmtyVA6HUfVX/ D0CA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=lFBNLNUb; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=lFBNLNUb; 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-133062-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133062-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v8-20020a0561020f0800b0047843dcac9bsi214151vss.95.2024.04.05.06.25.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 06:25:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133062-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=lFBNLNUb; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=lFBNLNUb; 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-133062-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133062-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 6B49B1C22EEA for ; Fri, 5 Apr 2024 13:25:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C9A7416D4CB; Fri, 5 Apr 2024 13:25:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="lFBNLNUb"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="fcOxNc9h"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="lFBNLNUb"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="fcOxNc9h" 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 6AED415FD16 for ; Fri, 5 Apr 2024 13:25:24 +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=1712323525; cv=none; b=TOhGR+juDFRWA3oVoFufh90oUrJundR7HA3bf88Ma0piQW3ZmH0CbagnRw2UqlAfaP6hHpw3Tu7gjMIUbw+8WPLMZ79wKH//jNJr77Hf8QfMq88LelXRxA98xTyJeDyOrELdkgVZLmTscVaT/zlGk5x2oirQWdIAO6NJhI5GDK8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712323525; c=relaxed/simple; bh=iLdba+FCvagX1vgwBB94s5I8geWS8ZAoFqavH1fpllg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RY10a+U32MNbjE6dLzaViqitwZ3qteTg47fPJ6H95eWD0ivPf/8MBmVwsizHLSm0pnrwHzzdNrfCNjO9mwSVUsfQyWgvY40m0PA74SwaJcrFpHKDU5puXIiEAAovdzyyfJ12lmC6lAYWFLcRo6SE1Kw/8SJsjmpRfsDjhyxdkTQ= 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=lFBNLNUb; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=fcOxNc9h; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=lFBNLNUb; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=fcOxNc9h; 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 9629A21A41; Fri, 5 Apr 2024 13:25:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712323522; 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=PJC3Z1irT0+nnttWGlCwrHW635IJ8lN25LyXL+82QFU=; b=lFBNLNUbFnYkutVradXzW3rkfxETWkp10yjx4uOPAAovCfUzOSt14yLOw4yCxI5CoDIeXk Yv4X7qGxtc7LFCsfRJlI8RlTAE6MN55mq4GA+uYCbakhPmtEJ3dZXNs3Kku3nlflh19BWz AxvhCTREQ2QUi6aqJ0QU5K61ZeAB8k0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712323522; 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=PJC3Z1irT0+nnttWGlCwrHW635IJ8lN25LyXL+82QFU=; b=fcOxNc9hAkvQdUSSb/A5XSl4e8oEUWkmK31vPNqb8uhPfrNt+XntR/T1ZijH4b22MPIU/X 80LQdXPwvXVmgwDQ== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=lFBNLNUb; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=fcOxNc9h DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712323522; 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=PJC3Z1irT0+nnttWGlCwrHW635IJ8lN25LyXL+82QFU=; b=lFBNLNUbFnYkutVradXzW3rkfxETWkp10yjx4uOPAAovCfUzOSt14yLOw4yCxI5CoDIeXk Yv4X7qGxtc7LFCsfRJlI8RlTAE6MN55mq4GA+uYCbakhPmtEJ3dZXNs3Kku3nlflh19BWz AxvhCTREQ2QUi6aqJ0QU5K61ZeAB8k0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712323522; 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=PJC3Z1irT0+nnttWGlCwrHW635IJ8lN25LyXL+82QFU=; b=fcOxNc9hAkvQdUSSb/A5XSl4e8oEUWkmK31vPNqb8uhPfrNt+XntR/T1ZijH4b22MPIU/X 80LQdXPwvXVmgwDQ== 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 83844139F1; Fri, 5 Apr 2024 13:25:22 +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 b/qrHsL7D2blLAAAn2gu4w (envelope-from ); Fri, 05 Apr 2024 13:25:22 +0000 Date: Fri, 5 Apr 2024 15:24:57 +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: 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> X-Spam-Flag: NO X-Spam-Score: -4.01 X-Rspamd-Action: no action X-Rspamd-Queue-Id: 9629A21A41 X-Spam-Level: X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:98:from]; RCVD_TLS_ALL(0.00)[]; MISSING_XM_UA(0.00)[]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCPT_COUNT_SEVEN(0.00)[8]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:98:from]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,imap2.dmz-prg2.suse.org:helo,imap2.dmz-prg2.suse.org:rdns]; 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 12:02:52PM +0200, Daniel Wagner wrote: > 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. I think I start to understand your feedback. I'll try to address it.