nvme-fc: do not warn on controller removal race
Subsystems (2)
PATCH 1/1 nvme-fc: do not warn on controller removal race
In nvme_fc_reconnect_or_delete(), the system attempts to remove the controller when reconnect limits are reached by calling nvme_delete_ctrl(). This call is currently wrapped in a WARN_ON().
If a user concurrently deletes the controller via sysfs, the controller's state may have already transitioned out of the CONNECTING state. When this happens, nvme_delete_ctrl() correctly rejects the operation and returns -EBUSY. Because of the WARN_ON() wrapper, this race condition triggers an unnecessary kernel warning stack trace.
Remove the WARN_ON() macro around nvme_delete_ctrl(); this allows the system to safely ignore the -EBUSY return value if the controller is already being deleted.
--- drivers/nvme/host/fc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/fc.c +1 -1
@@ -3338,7 +3338,7 @@ nvme_fc_reconnect_or_delete(struct nvme_fc_ctrl *ctrl, int status) ctrl->cnum,min_t (int, portptr->dev_loss_tmo, (ctrl->ctrl.opts->max_reconnects * ctrl->ctrl.opts->reconnect_delay))); -WARN_ON (nvme_delete_ctrl (&ctrl->ctrl)); +nvme_delete_ctrl (&ctrl->ctrl); } }
Signature · 1 line
2.55.0
Quoted 11 lines · Maurizio Lombardi
In
nvme_fc_reconnect_or_delete(), the system attempts to remove the controller when reconnect limits are reached by callingnvme_delete_ctrl(). This call is currently wrapped in aWARN_ON().If a user concurrently deletes the controller via sysfs, the controller's state may have already transitioned out of the CONNECTING state. When this happens,
nvme_delete_ctrl()correctly rejects the operation and returns-EBUSY. Because of theWARN_ON()wrapper, this race condition triggers an unnecessary kernel warning stack trace.
Quoted 3 lines
Remove the
WARN_ON()macro aroundnvme_delete_ctrl(); this allows the system to safely ignore the-EBUSYreturn value if the controller is already being deleted.
Yes, this makes sense.
Quoted 25 lines · Maurizio Lombardi
In
nvme_fc_reconnect_or_delete(), the system attempts to remove the controller when reconnect limits are reached by callingnvme_delete_ctrl(). This call is currently wrapped in aWARN_ON().If a user concurrently deletes the controller via sysfs, the controller's state may have already transitioned out of the CONNECTING state. When this happens,
nvme_delete_ctrl()correctly rejects the operation and returns-EBUSY. Because of theWARN_ON()wrapper, this race condition triggers an unnecessary kernel warning stack trace.Remove the
WARN_ON()macro aroundnvme_delete_ctrl(); this allows the system to safely ignore the-EBUSYreturn value if the controller is already being deleted.Signed-off-by Maurizio Lombardi <[email protected]>--- drivers/nvme/host/fc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/nvme/host/fc.c +0
-0
drivers/nvme/host/fc.c nvme_fc_reconnect_or_delete(struct nvme_fc_ctrl *ctrl, int status) · line 3344
Quoted 8 lines
drivers/nvme/host/fc.c +1
-1@@ -3338,7 +3338,7 @@ nvme_fc_reconnect_or_delete(struct nvme_fc_ctrl *ctrl, int status) ctrl->cnum,min_t (int, portptr->dev_loss_tmo, (ctrl->ctrl.opts->max_reconnects * ctrl->ctrl.opts->reconnect_delay))); -WARN_ON (nvme_delete_ctrl (&ctrl->ctrl)); +nvme_delete_ctrl (&ctrl->ctrl); } }
Cheers,
Hannes
Signature · 4 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich