From patchwork Mon Jul 31 14:51:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark O'Donovan X-Patchwork-Id: 128782 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp2116900vqg; Mon, 31 Jul 2023 09:13:42 -0700 (PDT) X-Google-Smtp-Source: APBJJlE4nYdZGwvoTYz/DTRn8gdW0g1jU9WjliP7kotlPeFPKOLuNAdaLsDXJD2vyRYddAah4ih2 X-Received: by 2002:a17:90a:a58d:b0:262:f0d0:97c0 with SMTP id b13-20020a17090aa58d00b00262f0d097c0mr9695218pjq.32.1690820021862; Mon, 31 Jul 2023 09:13:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690820021; cv=none; d=google.com; s=arc-20160816; b=h5IHn1F2svYHFEAhIEjfMnw8W5q2tfaB0t38WQE/9MBkiBcHESBLxPtGpYDc8lPYcT ghSTdpyYW1joUq5rsfsS8NOp287CAWcua4zxZkT/48lpszjqXl+VH21Aal8H2sjd6bgX ELZ2yQhOx5W9gn9TIUGrSfuYjcHs7KCYTONytXLhT6q+muPDMzNlpBoSqPcA09EYkNVT jUakRQubgDgfoUpx32u4aKGAOSVgC+jmEYF+mHyfCkoAVQ4O4C+GMKKc8VMAuiKx0goV 4ft8SECyONJ2nHUZ1CTl3X0B9GIV4buGoahdTKEovTckfIikCUy6RQ0ERNnQZY6dxe6i /4ZA== 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=c4Q6nswl7adnvle4sIwtUJF9tAtvVTB8NezbTkNtatk=; fh=tx6UY9TwX+teoyR/HYSM8vHsN0c+VaB2nONDfxVPY2A=; b=BNUkw5IL6nXVYknZCvdj0awSIw6t8EDReyDZ/NTroOlC3f+sLRAZl0l7LxF0LrUv0i rbd9oOq3x6AT5/0wTZZgB0d0S9JfjHMOdEYu9cE6rnVFc8ND5b4KZSfu+r2EeByvyKWn qV7YyRjYfT2z5XgvJlppBVqC1llcU2wp5gU8sp2BoUaz3JrhQf7S4EiiIjIomsCFYPUr 6cOCtk3l/qSsPGTBVTulAo5JWP+BG7gUev9uP49tSy7AQqY2CHHkv3xMWCsExccySzK/ SQqyPAkNHtY271e8isV4y00QWU1I/x5kqOB24XdbdukFW9DQcD6lM99TulheABefg5yL zsMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=b2rJAhH7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e15-20020a17090a9a8f00b002682b173a2fsi9252229pjp.148.2023.07.31.09.13.28; Mon, 31 Jul 2023 09:13:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=b2rJAhH7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230494AbjGaPAr (ORCPT + 99 others); Mon, 31 Jul 2023 11:00:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231495AbjGaPAp (ORCPT ); Mon, 31 Jul 2023 11:00:45 -0400 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A863A120 for ; Mon, 31 Jul 2023 08:00:41 -0700 (PDT) Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 57E70240101 for ; Mon, 31 Jul 2023 17:00:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1690815638; bh=IvLmPEmw9kMuEQzvbUm2FqmKdi2Hp7a+u6Dag9e2cQM=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version: Content-Transfer-Encoding:From; b=b2rJAhH7XN+U2h1IPMof9q8aYTETIZR8JWHE47jm5imuVvyCscpcIfhTAfCKl5heH scCYFDGhWc9xmvUBdulpsNHCSSwapO94odN/aORyNToc3hk8bXYd4Kujr+ZWyUxCnc UqUszWhAL/4pPS08fWp3At5vYzgqmzhCtEU3vmFUP0wHd6Tabvhg6axLykF7OY3cNq EIvvioF2ivlt26z7jerets5aHY1V+ONjaxeIMQ9DmmwFH7a5fQ6viHKnNsw34NdZma sTzD8Iw7V+qbptsC9wuDGeNYXSp3flcTtgK7pfEXtwVS7yFfXGTCGlV9NH+g3d/56Y SOoT1hEJgpv6Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RF1dK2GsRz9sDs; Mon, 31 Jul 2023 17:00:37 +0200 (CEST) From: Mark O'Donovan To: linux-kernel@vger.kernel.org Cc: linux-nvme@lists.infradead.org, axboe@kernel.dk, kbusch@kernel.org, hare@suse.de, Mark O'Donovan Subject: [PATCH v2 2/2] nvme-auth: set explanation code for failure2 msgs Date: Mon, 31 Jul 2023 14:51:06 +0000 Message-Id: <20230731145106.917526-2-shiftee@posteo.net> In-Reply-To: <20230731145106.917526-1-shiftee@posteo.net> References: <20230731145106.917526-1-shiftee@posteo.net> MIME-Version: 1.0 X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772953295236505621 X-GMAIL-MSGID: 1772953295236505621 Some error cases were not setting an auth-failure-reason-code-explanation. This means an AUTH_Failure2 message will be sent with an explanation value of 0 which is a reserved value. Signed-off-by: Mark O'Donovan Reviewed-by: Hannes Reinecke --- v1->v2: Set failure explanation in a single place if the error handling code has not already done so. drivers/nvme/host/auth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/nvme/host/auth.c b/drivers/nvme/host/auth.c index e1a98647c3a2..9556cfc4f5f3 100644 --- a/drivers/nvme/host/auth.c +++ b/drivers/nvme/host/auth.c @@ -839,6 +839,8 @@ static void nvme_queue_auth_work(struct work_struct *work) } fail2: + if (chap->status == 0) + chap->status = NVME_AUTH_DHCHAP_FAILURE_FAILED; dev_dbg(ctrl->device, "%s: qid %d send failure2, status %x\n", __func__, chap->qid, chap->status); tl = nvme_auth_set_dhchap_failure2_data(ctrl, chap);