Skip to content

Commit fef7fd4

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Three small fixes, all in drivers. The sas one is in an unlikely error leg, the debug one is to make it more standards conformant and the ibmvfc one is to fix a user visible bug where a failover could lose all paths to the device" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: scsi_debug: Make the READ CAPACITY response compliant with ZBC scsi: scsi_transport_sas: Fix error handling in sas_phy_add() scsi: ibmvfc: Avoid path failures during live migration
2 parents f95077a + ecb8c25 commit fef7fd4

File tree

3 files changed

+27
-7
lines changed

3 files changed

+27
-7
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);

drivers/scsi/scsi_debug.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1899,6 +1899,13 @@ static int resp_readcap16(struct scsi_cmnd *scp,
18991899
arr[14] |= 0x40;
19001900
}
19011901

1902+
/*
1903+
* Since the scsi_debug READ CAPACITY implementation always reports the
1904+
* total disk capacity, set RC BASIS = 1 for host-managed ZBC devices.
1905+
*/
1906+
if (devip->zmodel == BLK_ZONED_HM)
1907+
arr[12] |= 1 << 4;
1908+
19021909
arr[15] = sdebug_lowest_aligned & 0xff;
19031910

19041911
if (have_dif_prot) {

drivers/scsi/scsi_transport_sas.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -722,12 +722,17 @@ int sas_phy_add(struct sas_phy *phy)
722722
int error;
723723

724724
error = device_add(&phy->dev);
725-
if (!error) {
726-
transport_add_device(&phy->dev);
727-
transport_configure_device(&phy->dev);
725+
if (error)
726+
return error;
727+
728+
error = transport_add_device(&phy->dev);
729+
if (error) {
730+
device_del(&phy->dev);
731+
return error;
728732
}
733+
transport_configure_device(&phy->dev);
729734

730-
return error;
735+
return 0;
731736
}
732737
EXPORT_SYMBOL(sas_phy_add);
733738

0 commit comments

Comments
 (0)