mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@kernel.org>
To: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
	 Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	 Hannes Reinecke <hare@suse.de>,
	Chaitanya Kulkarni <kch@nvidia.com>
Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
	 Hannes Reinecke <hare@kernel.org>
Subject: [PATCH v5 7/9] nvme-auth: wait for authentication to finish when changing keys
Date: Mon, 23 Nov 2026 13:14:52 +0100	[thread overview]
Message-ID: <20261123-dhchap-keyring-v4-v5-7-81eefb4c0724@kernel.org> (raw)
In-Reply-To: <20261123-dhchap-keyring-v4-v5-0-81eefb4c0724@kernel.org>

When changing DH-HMAC-CHAP keys in sysfs we need to wait for authentication
to complete on all queues. Otherwise the user might change the keys while
authentication is in progress, causing the authentication to fail and
I/O to be interrupted.

Signed-off-by: Hannes Reinecke <hare@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
---
 drivers/nvme/host/sysfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/sysfs.c b/drivers/nvme/host/sysfs.c
index e6d42da84e1688110eb81e59161dc7c497bd0627..33f78914e8b5e6331e3a82f6bafa3c0bdc0b8ea6 100644
--- a/drivers/nvme/host/sysfs.c
+++ b/drivers/nvme/host/sysfs.c
@@ -903,7 +903,7 @@ static ssize_t dhchap_secret_store(struct device *dev,
 	/* Start re-authentication */
 	dev_info(ctrl->device, "re-authenticating controller\n");
 	queue_work(nvme_wq, &ctrl->dhchap_auth_work);
-
+	flush_work(&ctrl->dhchap_auth_work);
 	return count;
 }
 
@@ -995,7 +995,7 @@ static ssize_t dhchap_ctrl_secret_store(struct device *dev,
 	/* Start re-authentication */
 	dev_info(ctrl->device, "re-authenticating controller\n");
 	queue_work(nvme_wq, &ctrl->dhchap_auth_work);
-
+	flush_work(&ctrl->dhchap_auth_work);
 	return count;
 }
 

-- 
2.51.0


  parent reply	other threads:[~2026-11-23 12:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 12:14 [PATCH v5 0/9] nvme-auth: switch to use the kernel keyring Hannes Reinecke
2026-11-23 12:14 ` [PATCH v5 1/9] nvme-auth: modify nvme_auth_transform_key() to return status Hannes Reinecke
2026-11-23 12:14 ` [PATCH v5 2/9] nvme-keyring: add 'dhchap' key type Hannes Reinecke
2026-11-23 12:14 ` [PATCH v5 3/9] nvme-auth: switch to use 'struct key' Hannes Reinecke
2026-11-23 12:14 ` [PATCH v5 4/9] nvme: parse dhchap keys during option parsing Hannes Reinecke
2026-11-23 12:14 ` [PATCH v5 5/9] nvmet-auth: parse dhchap key from configfs attribute Hannes Reinecke
2026-11-23 12:14 ` [PATCH v5 6/9] nvme: allow to pass in key description as dhchap secret Hannes Reinecke
2026-11-23 12:14 ` Hannes Reinecke [this message]
2026-11-23 12:14 ` [PATCH v5 8/9] nvme-fabrics: allow to pass in keyring by name Hannes Reinecke
2026-11-23 12:14 ` [PATCH v5 9/9] nvmet: add configfs attribute 'dhchap_keyring' Hannes Reinecke
2026-11-23 12:59 ` [PATCH v5 0/9] nvme-auth: switch to use the kernel keyring Martin Belanger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261123-dhchap-keyring-v4-v5-7-81eefb4c0724@kernel.org \
    --to=hare@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=kch@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®