From patchwork Mon Jul 31 14:51:05 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: 128789 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp2145794vqg; Mon, 31 Jul 2023 10:04:50 -0700 (PDT) X-Google-Smtp-Source: APBJJlEr7XmidW1fEhbnVlZbOobMIgjdaPmg3TcQNvPWgzUMEme8PngqX9KbTBu6J6IujBKwG0gv X-Received: by 2002:aa7:df02:0:b0:51e:2282:e1fc with SMTP id c2-20020aa7df02000000b0051e2282e1fcmr403095edy.6.1690823090146; Mon, 31 Jul 2023 10:04:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690823090; cv=none; d=google.com; s=arc-20160816; b=sCltwTkE2KkwT8Xq5esfYhI7GQQRqFxNChNJGVAA18DjIU6yTFD7c7RjncSYT62yKK RhoOex9Slhc6mAq0aQP8UlBSKpeIBKTQBBr4kSMBs3Wmampaj3fQMGaVX7H7bUyQ+CRu CdVkPdrLR/ekqoPAEfIPSJwCU8kvdVJXS7DzZCmiNw2UnzjPZHNyT+vmrPh0M50RfftJ ya4tN4HK7ZQO5HVWQy3TDtNXMwGvlZnIkI+ISQ45HzvgAHXbdLqy5Ynzi41cjg8Ks4FN IP/vHN0kV3qA5uXTZ0EtR4kU90eN94up/IABfYSwcmwVpBZdcyL60DcRxvysK6+T4rDd FZdw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=z9mrYk9ezevgnVRh6fo8v+zzdhxngLuWQKAfOQIGxIk=; fh=OWp1JE7RoKE/G7JKZdGUrLBi8WjeFKNi5RN//eKMHcA=; b=xhcYgAfMTsSKpdM612+gbXHUQEytEn+T31yYbgHB8EWGL2ZOero0nsvEFFSCG3+Lms 7Hv3Z+sWLE3Ye+NcOEnt8Z0m7p372680lKmWv9iC1OKvlMykes7tOLY4acbxZbTczp3U 7GfMlPb8nfGldvy+QeXkSE5+dBsc7QnE7mGkUIddRJ2ESLj6aN2qc3pBjsyxM6Kmrj/s 2/yyRnEycfgtpjf/ZT0gwPk2oUp8jzxokovI0JBlCjoQAsNbs2FhUrfbYZTXrMOt8onb +0am6NkGtrqaDNXmsZpHdIyj0GSXD7o+nlZXx93aZ73/EoOSer0vbt9CC6Hz36O+8PeX oyHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=izyE3ONG; 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 p25-20020a056402075900b0052278a08504si3094474edy.485.2023.07.31.10.04.17; Mon, 31 Jul 2023 10:04:50 -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=izyE3ONG; 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 S230266AbjGaPAo (ORCPT + 99 others); Mon, 31 Jul 2023 11:00:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229955AbjGaPAn (ORCPT ); Mon, 31 Jul 2023 11:00:43 -0400 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E13A3E78 for ; Mon, 31 Jul 2023 08:00:39 -0700 (PDT) Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id A06AE240029 for ; Mon, 31 Jul 2023 17:00:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1690815637; bh=XImkWyr8X4KhNLsQctrbLiFktbFlqmuLxa0+EGeRPJA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version: Content-Transfer-Encoding:From; b=izyE3ONGaA+0jfWhgRU//8h85d0ObOdP7jK5FSSx3X2DTKilXfgsxG5TKQn0jbw5n LgEheEDXQlvdZBXqmxPJEv+C7Osk4ItDJu7cJz3+g844hRbLemMkcU+O06ugrIbupa 9PS7mvZ5yrDb05/OlJxf6zQDyA0+PEzjRZce2zjgLpYJJC9TfUMWbb7zl2ONGoaV6t 9JdqfLFyUP0H4NVNygbi270PXhv7S9HLAiFKAn4QKKyvaD1NP5rFPqRsoiTuycyNTz y1HyY9x/JB1bFtI+znYZjYkBW1YUP3FqgS2GJ2P7U93sNfVsWlyHLcMAtSLic+VhqL 49PMktOwVpYWw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RF1dH2n7bz9s0p; Mon, 31 Jul 2023 17:00:35 +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 , Christoph Hellwig , Sagi Grimberg Subject: [PATCH v2 1/2] nvme-auth: unlock mutex in one place only Date: Mon, 31 Jul 2023 14:51:05 +0000 Message-Id: <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: 1772956133760603133 X-GMAIL-MSGID: 1772956512542562178 Signed-off-by: Mark O'Donovan Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg --- drivers/nvme/host/auth.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/nvme/host/auth.c b/drivers/nvme/host/auth.c index daf5d144a8ea..e1a98647c3a2 100644 --- a/drivers/nvme/host/auth.c +++ b/drivers/nvme/host/auth.c @@ -758,12 +758,11 @@ static void nvme_queue_auth_work(struct work_struct *work) __func__, chap->qid); mutex_lock(&ctrl->dhchap_auth_mutex); ret = nvme_auth_dhchap_setup_host_response(ctrl, chap); + mutex_unlock(&ctrl->dhchap_auth_mutex); if (ret) { - mutex_unlock(&ctrl->dhchap_auth_mutex); chap->error = ret; goto fail2; } - mutex_unlock(&ctrl->dhchap_auth_mutex); /* DH-HMAC-CHAP Step 3: send reply */ dev_dbg(ctrl->device, "%s: qid %d send reply\n",