]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Jan 2024 17:15:39 +0000 (18:15 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Jan 2024 17:15:39 +0000 (18:15 +0100)
added patches:
revert-nvme-fc-fix-race-between-error-recovery-and-creating-association.patch

queue-6.6/revert-nvme-fc-fix-race-between-error-recovery-and-creating-association.patch [new file with mode: 0644]
queue-6.6/series

diff --git a/queue-6.6/revert-nvme-fc-fix-race-between-error-recovery-and-creating-association.patch b/queue-6.6/revert-nvme-fc-fix-race-between-error-recovery-and-creating-association.patch
new file mode 100644 (file)
index 0000000..c284d86
--- /dev/null
@@ -0,0 +1,78 @@
+From d3e8b1858734bf46cda495be4165787b9a3981a6 Mon Sep 17 00:00:00 2001
+From: Keith Busch <kbusch@kernel.org>
+Date: Mon, 18 Dec 2023 08:19:39 -0800
+Subject: Revert "nvme-fc: fix race between error recovery and creating association"
+
+From: Keith Busch <kbusch@kernel.org>
+
+commit d3e8b1858734bf46cda495be4165787b9a3981a6 upstream.
+
+The commit was identified to might sleep in invalid context and is
+blocking regression testing.
+
+This reverts commit ee6fdc5055e916b1dd497f11260d4901c4c1e55e.
+
+Link: https://lore.kernel.org/linux-nvme/hkhl56n665uvc6t5d6h3wtx7utkcorw4xlwi7d2t2bnonavhe6@xaan6pu43ap6/
+Link: https://lists.infradead.org/pipermail/linux-nvme/2023-December/043756.html
+Reported-by: Daniel Wagner <dwagner@suse.de>
+Reported-by: Maurizio Lombardi <mlombard@redhat.com>
+Cc: Michael Liang <mliang@purestorage.com>
+Tested-by: Daniel Wagner <dwagner@suse.de>
+Reviewed-by: Daniel Wagner <dwagner@suse.de>
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
+Signed-off-by: Keith Busch <kbusch@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/nvme/host/fc.c |   21 +++++----------------
+ 1 file changed, 5 insertions(+), 16 deletions(-)
+
+--- a/drivers/nvme/host/fc.c
++++ b/drivers/nvme/host/fc.c
+@@ -2548,24 +2548,17 @@ nvme_fc_error_recovery(struct nvme_fc_ct
+        * the controller.  Abort any ios on the association and let the
+        * create_association error path resolve things.
+        */
+-      enum nvme_ctrl_state state;
+-      unsigned long flags;
+-
+-      spin_lock_irqsave(&ctrl->lock, flags);
+-      state = ctrl->ctrl.state;
+-      if (state == NVME_CTRL_CONNECTING) {
+-              set_bit(ASSOC_FAILED, &ctrl->flags);
+-              spin_unlock_irqrestore(&ctrl->lock, flags);
++      if (ctrl->ctrl.state == NVME_CTRL_CONNECTING) {
+               __nvme_fc_abort_outstanding_ios(ctrl, true);
++              set_bit(ASSOC_FAILED, &ctrl->flags);
+               dev_warn(ctrl->ctrl.device,
+                       "NVME-FC{%d}: transport error during (re)connect\n",
+                       ctrl->cnum);
+               return;
+       }
+-      spin_unlock_irqrestore(&ctrl->lock, flags);
+       /* Otherwise, only proceed if in LIVE state - e.g. on first error */
+-      if (state != NVME_CTRL_LIVE)
++      if (ctrl->ctrl.state != NVME_CTRL_LIVE)
+               return;
+       dev_warn(ctrl->ctrl.device,
+@@ -3179,16 +3172,12 @@ nvme_fc_create_association(struct nvme_f
+               else
+                       ret = nvme_fc_recreate_io_queues(ctrl);
+       }
+-
+-      spin_lock_irqsave(&ctrl->lock, flags);
+       if (!ret && test_bit(ASSOC_FAILED, &ctrl->flags))
+               ret = -EIO;
+-      if (ret) {
+-              spin_unlock_irqrestore(&ctrl->lock, flags);
++      if (ret)
+               goto out_term_aen_ops;
+-      }
++
+       changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE);
+-      spin_unlock_irqrestore(&ctrl->lock, flags);
+       ctrl->ctrl.nr_reconnects = 0;
index 86a154b624409ea40a3019525b400c1132370fe9..da29cdeb8577f1eec4b776c8d1d1d15410dff1ac 100644 (file)
@@ -40,3 +40,4 @@ mm-filemap-avoid-buffered-read-write-race-to-read-inconsistent-data.patch
 mm-migrate-high-order-folios-in-swap-cache-correctly.patch
 mm-memory-failure-cast-index-to-loff_t-before-shifting-it.patch
 mm-memory-failure-check-the-mapcount-of-the-precise-page.patch
+revert-nvme-fc-fix-race-between-error-recovery-and-creating-association.patch