Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp504125lqp; Thu, 4 Apr 2024 23:21:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU106pkidtUBH/FgEcaaHeYWjWFwRrc6K4JcDcFARflxTw7AxZ51LVor8qzrI1l9cZWCDapOBoZ8WNt4rlHaBT3+ruKgw1ZO0Hde9luyg== X-Google-Smtp-Source: AGHT+IELrOqDLFN3aHZLXNhc62qxvroUMV9HfGia3zEgZ3GTR8706fm6jQ1ArVFiwECqYs0fFi/n X-Received: by 2002:a17:906:f218:b0:a51:a676:db26 with SMTP id gt24-20020a170906f21800b00a51a676db26mr297704ejb.21.1712298068128; Thu, 04 Apr 2024 23:21:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712298068; cv=pass; d=google.com; s=arc-20160816; b=qkgNkvmHyMN6X9lgDHavKfM+Vi4UAKXP9Huka9lzspkkfHQmFKgPh3upojwxWorI8p 7BAMjXgBfwK+rfmYOrjDqnTHVx+nrZsVa3zTkbwl2/wunZplJbu4VClKYEoaxGYIzzDg ova5Jf8FsZUnq2KvrBw8OX6ZdXBoxqRfz7t3K2+CCRTDYCX9odoDlI3lpfw0d3eixoFz 1Av/yt5iQJ8bYlblGtuv60ei6HFG6lChG5BKwC3bp5GhTAmGa2i9a75F6dYPpy8syIyR C8Y40CHMV5+neVXoXHmjdX4zkZu8TZrMN4OZlNit0ZxcTtdyUUjUiPX5ZnsAjbRjVRNh LFyg== 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=6+apoXZAd6PTQuEu5dOZzXYX7VK6YP8dt1XmvCY6yGY=; fh=LVa7h9R8QkQ8WVmNvzHA99kAE8yOvkN9q+3tvhsA0es=; b=BHMPqqb7CNR1ZcVfatRFMw6iich2HyT5VW4duprsiD+LeYh/IJ4o3yHOz4ek5F1M3J zBR9R2DCEW6XtBr3dY76CBV5VQq8csAT6Unj+y2ZFwJiUTyeQLDcvveOKZ3B5hHNyC+p iyVWGpacTZtmK5zsido2+AxAHFedosYQECmW8Nt6nVdnEdF8QFDNxx7u6dW4tugS8bH9 zNjw4MwFEpUFCVulm6iXe2SaFDeaPPQLScVWsJau6iEdRlAkTPnd9toH9GnKLnCxN4JI PM0A1EEEd7X7kymauTfgpVtmKeTdBvxTQGEXQTU0km0dOg62a8Xw6ZUstbBq/sVOC3gP 83dQ==; 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-132466-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132466-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q5-20020a1709060e4500b00a4e6a412419si381246eji.457.2024.04.04.23.21.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 23:21:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-132466-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; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-132466-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132466-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 am.mirrors.kernel.org (Postfix) with ESMTPS id D64F21F24F6C for ; Fri, 5 Apr 2024 06:21:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9867422626; Fri, 5 Apr 2024 06:21:01 +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 A8AD32232B for ; Fri, 5 Apr 2024 06:20:59 +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=1712298061; cv=none; b=eCHbiaY7TgCPaGh676Bs/mffM5vv8OEEpMwUwR0fxt4z+fdM21H8gbS63ksx1N+kpVZOQ0x1u3P4Wkc1j3gwtGKtk27rtTFszKjJGzERwhr2DdIZfs2c8cS1FNlPNqAifnPM1gCkxSRRU9qYOX+83pG/odYIIKviQTq8M/EUHZE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712298061; c=relaxed/simple; bh=cZAm21SU+Jj9MjstbKMYQxrL1VG7W0eKArYSvFonf10=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=I8gSMM36y2cwj7AoQhPUx8fyrhrgfNUrnaHC5gOgykKBOq3TsHr5YBLlksOS99YKXElhA3c4gyPlfmFI5cSKH+xsRm9MxQZSfGPhixkbtzN7evgGgcN6NDXv0XfML7YzTNNFXUVALtd/2lW+8L/6FJ3Z81uF8xFwyIRcLhgOHpw= 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 C327168D07; Fri, 5 Apr 2024 08:20:55 +0200 (CEST) Date: Fri, 5 Apr 2024 08:20:55 +0200 From: Christoph Hellwig To: Daniel Wagner Cc: James Smart , Keith Busch , Christoph Hellwig , 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: <20240405062055.GC3107@lst.de> References: <20240404154500.2101-1-dwagner@suse.de> <20240404154500.2101-4-dwagner@suse.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: <20240404154500.2101-4-dwagner@suse.de> User-Agent: Mutt/1.5.17 (2007-11-01) On Thu, Apr 04, 2024 at 05:44:58PM +0200, Daniel Wagner wrote: > From: Hannes Reinecke > > A failure in nvmet_setup_auth() does not mean that the NVMe > authentication command failed, so we should rather return a > protocol error with a 'failure1' response than an NVMe status. Nit: try to use up the 73 characters available for commit logs, this looks weirdly, um condensed. > @@ -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.