Skip to content

Commit 5254c0c

Browse files
committed
Merge tag 'block-6.7-2023-12-22' of git://git.kernel.dk/linux
Pull block fixes from Jens Axboe: "Just an NVMe pull request this time, with a fix for bad sleeping context, and a revert of a patch that caused some trouble" * tag 'block-6.7-2023-12-22' of git://git.kernel.dk/linux: nvme-pci: fix sleeping function called from interrupt context Revert "nvme-fc: fix race between error recovery and creating association"
2 parents 867583b + 13d822b commit 5254c0c

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

drivers/nvme/host/core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4137,6 +4137,8 @@ static void nvme_fw_act_work(struct work_struct *work)
41374137
struct nvme_ctrl, fw_act_work);
41384138
unsigned long fw_act_timeout;
41394139

4140+
nvme_auth_stop(ctrl);
4141+
41404142
if (ctrl->mtfa)
41414143
fw_act_timeout = jiffies +
41424144
msecs_to_jiffies(ctrl->mtfa * 100);
@@ -4192,7 +4194,6 @@ static bool nvme_handle_aen_notice(struct nvme_ctrl *ctrl, u32 result)
41924194
* firmware activation.
41934195
*/
41944196
if (nvme_change_ctrl_state(ctrl, NVME_CTRL_RESETTING)) {
4195-
nvme_auth_stop(ctrl);
41964197
requeue = false;
41974198
queue_work(nvme_wq, &ctrl->fw_act_work);
41984199
}

drivers/nvme/host/fc.c

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2548,24 +2548,17 @@ nvme_fc_error_recovery(struct nvme_fc_ctrl *ctrl, char *errmsg)
25482548
* the controller. Abort any ios on the association and let the
25492549
* create_association error path resolve things.
25502550
*/
2551-
enum nvme_ctrl_state state;
2552-
unsigned long flags;
2553-
2554-
spin_lock_irqsave(&ctrl->lock, flags);
2555-
state = ctrl->ctrl.state;
2556-
if (state == NVME_CTRL_CONNECTING) {
2557-
set_bit(ASSOC_FAILED, &ctrl->flags);
2558-
spin_unlock_irqrestore(&ctrl->lock, flags);
2551+
if (ctrl->ctrl.state == NVME_CTRL_CONNECTING) {
25592552
__nvme_fc_abort_outstanding_ios(ctrl, true);
2553+
set_bit(ASSOC_FAILED, &ctrl->flags);
25602554
dev_warn(ctrl->ctrl.device,
25612555
"NVME-FC{%d}: transport error during (re)connect\n",
25622556
ctrl->cnum);
25632557
return;
25642558
}
2565-
spin_unlock_irqrestore(&ctrl->lock, flags);
25662559

25672560
/* Otherwise, only proceed if in LIVE state - e.g. on first error */
2568-
if (state != NVME_CTRL_LIVE)
2561+
if (ctrl->ctrl.state != NVME_CTRL_LIVE)
25692562
return;
25702563

25712564
dev_warn(ctrl->ctrl.device,
@@ -3180,16 +3173,12 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)
31803173
else
31813174
ret = nvme_fc_recreate_io_queues(ctrl);
31823175
}
3183-
3184-
spin_lock_irqsave(&ctrl->lock, flags);
31853176
if (!ret && test_bit(ASSOC_FAILED, &ctrl->flags))
31863177
ret = -EIO;
3187-
if (ret) {
3188-
spin_unlock_irqrestore(&ctrl->lock, flags);
3178+
if (ret)
31893179
goto out_term_aen_ops;
3190-
}
3180+
31913181
changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE);
3192-
spin_unlock_irqrestore(&ctrl->lock, flags);
31933182

31943183
ctrl->ctrl.nr_reconnects = 0;
31953184

0 commit comments

Comments
 (0)