Skip to content

Commit 62fa3ce

Browse files
bjking1martinkpetersen
authored andcommitted
scsi: ibmvfc: Avoid path failures during live migration
Fix an issue reported when performing a live migration when multipath is configured with a short fast fail timeout of 5 seconds and also to have no_path_retry set to fail. In this scenario, all paths would go into the devloss state while the ibmvfc driver went through discovery to log back in. On a loaded system, the discovery might take longer than 5 seconds, which was resulting in all paths being marked failed, which then resulted in a read only filesystem. This patch changes the migration code in ibmvfc to avoid deleting rports at all in this scenario, so we avoid losing all paths. Signed-off-by: Brian King <brking@linux.vnet.ibm.com> Link: https://lore.kernel.org/r/20221026181356.148517-1-brking@linux.vnet.ibm.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 307539e commit 62fa3ce

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

drivers/scsi/ibmvscsi/ibmvfc.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -708,8 +708,13 @@ static void ibmvfc_init_host(struct ibmvfc_host *vhost)
708708
memset(vhost->async_crq.msgs.async, 0, PAGE_SIZE);
709709
vhost->async_crq.cur = 0;
710710

711-
list_for_each_entry(tgt, &vhost->targets, queue)
712-
ibmvfc_del_tgt(tgt);
711+
list_for_each_entry(tgt, &vhost->targets, queue) {
712+
if (vhost->client_migrated)
713+
tgt->need_login = 1;
714+
else
715+
ibmvfc_del_tgt(tgt);
716+
}
717+
713718
scsi_block_requests(vhost->host);
714719
ibmvfc_set_host_action(vhost, IBMVFC_HOST_ACTION_INIT);
715720
vhost->job_step = ibmvfc_npiv_login;
@@ -3235,9 +3240,12 @@ static void ibmvfc_handle_crq(struct ibmvfc_crq *crq, struct ibmvfc_host *vhost,
32353240
/* We need to re-setup the interpartition connection */
32363241
dev_info(vhost->dev, "Partition migrated, Re-enabling adapter\n");
32373242
vhost->client_migrated = 1;
3243+
3244+
scsi_block_requests(vhost->host);
32383245
ibmvfc_purge_requests(vhost, DID_REQUEUE);
3239-
ibmvfc_link_down(vhost, IBMVFC_LINK_DOWN);
3246+
ibmvfc_set_host_state(vhost, IBMVFC_LINK_DOWN);
32403247
ibmvfc_set_host_action(vhost, IBMVFC_HOST_ACTION_REENABLE);
3248+
wake_up(&vhost->work_wait_q);
32413249
} else if (crq->format == IBMVFC_PARTNER_FAILED || crq->format == IBMVFC_PARTNER_DEREGISTER) {
32423250
dev_err(vhost->dev, "Host partner adapter deregistered or failed (rc=%d)\n", crq->format);
32433251
ibmvfc_purge_requests(vhost, DID_ERROR);

0 commit comments

Comments
 (0)