]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
nvme: centralize ctrl removal prints
authorMax Gurtovoy <maxg@mellanox.com>
Sun, 11 Mar 2018 15:46:06 +0000 (17:46 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 26 Mar 2018 14:53:43 +0000 (08:53 -0600)
nvme_delete_ctrl can be called from various contexts in parallel,
and cause duplicated information prints, even though the specific
context doesn't perform the actual removal. Instead, print the
information when the actual removal occurs.

Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/host/core.c
drivers/nvme/host/fc.c
drivers/nvme/host/rdma.c

index 5c729ab519114747e0a48aea036c02b3d9f60a6c..f29a07ef122f107de61fda89f6f090d1727895ca 100644 (file)
@@ -130,6 +130,9 @@ static void nvme_delete_ctrl_work(struct work_struct *work)
        struct nvme_ctrl *ctrl =
                container_of(work, struct nvme_ctrl, delete_work);
 
+       dev_info(ctrl->device,
+                "Removing ctrl: NQN \"%s\"\n", ctrl->opts->subsysnqn);
+
        flush_work(&ctrl->reset_work);
        nvme_stop_ctrl(ctrl);
        nvme_remove_namespaces(ctrl);
index 7f51f8414b97238e647ef37f13942755e4b83a16..7edaa30cb61b8b388d36ea588236b502d57f4885 100644 (file)
@@ -768,8 +768,7 @@ nvme_fc_ctrl_connectivity_loss(struct nvme_fc_ctrl *ctrl)
                 */
                if (nvme_reset_ctrl(&ctrl->ctrl)) {
                        dev_warn(ctrl->ctrl.device,
-                               "NVME-FC{%d}: Couldn't schedule reset. "
-                               "Deleting controller.\n",
+                               "NVME-FC{%d}: Couldn't schedule reset.\n",
                                ctrl->cnum);
                        nvme_delete_ctrl(&ctrl->ctrl);
                }
@@ -836,8 +835,7 @@ nvme_fc_unregister_remoteport(struct nvme_fc_remote_port *portptr)
                /* if dev_loss_tmo==0, dev loss is immediate */
                if (!portptr->dev_loss_tmo) {
                        dev_warn(ctrl->ctrl.device,
-                               "NVME-FC{%d}: controller connectivity lost. "
-                               "Deleting controller.\n",
+                               "NVME-FC{%d}: controller connectivity lost.\n",
                                ctrl->cnum);
                        nvme_delete_ctrl(&ctrl->ctrl);
                } else
@@ -2882,14 +2880,13 @@ nvme_fc_reconnect_or_delete(struct nvme_fc_ctrl *ctrl, int status)
                if (portptr->port_state == FC_OBJSTATE_ONLINE)
                        dev_warn(ctrl->ctrl.device,
                                "NVME-FC{%d}: Max reconnect attempts (%d) "
-                               "reached. Removing controller\n",
+                               "reached.\n",
                                ctrl->cnum, ctrl->ctrl.nr_reconnects);
                else
                        dev_warn(ctrl->ctrl.device,
                                "NVME-FC{%d}: dev_loss_tmo (%d) expired "
-                               "while waiting for remoteport connectivity. "
-                               "Removing controller\n", ctrl->cnum,
-                               portptr->dev_loss_tmo);
+                               "while waiting for remoteport connectivity.\n",
+                               ctrl->cnum, portptr->dev_loss_tmo);
                WARN_ON(nvme_delete_ctrl(&ctrl->ctrl));
        }
 }
index 4d84a73ee12d06907ea94ef77e3e654d6e2b2033..f5f460b8045ce9af844799af648dbe12089457c1 100644 (file)
@@ -899,7 +899,6 @@ static void nvme_rdma_reconnect_or_remove(struct nvme_rdma_ctrl *ctrl)
                queue_delayed_work(nvme_wq, &ctrl->reconnect_work,
                                ctrl->ctrl.opts->reconnect_delay * HZ);
        } else {
-               dev_info(ctrl->ctrl.device, "Removing controller...\n");
                nvme_delete_ctrl(&ctrl->ctrl);
        }
 }
@@ -2031,9 +2030,6 @@ static void nvme_rdma_remove_one(struct ib_device *ib_device, void *client_data)
        list_for_each_entry(ctrl, &nvme_rdma_ctrl_list, list) {
                if (ctrl->device->dev != ib_device)
                        continue;
-               dev_info(ctrl->ctrl.device,
-                       "Removing ctrl: NQN \"%s\", addr %pISp\n",
-                       ctrl->ctrl.opts->subsysnqn, &ctrl->addr);
                nvme_delete_ctrl(&ctrl->ctrl);
        }
        mutex_unlock(&nvme_rdma_ctrl_mutex);