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

Changed files
+28 -8
drivers
+11 -3
drivers/scsi/ibmvscsi/ibmvfc.c
··· 708 708 memset(vhost->async_crq.msgs.async, 0, PAGE_SIZE); 709 709 vhost->async_crq.cur = 0; 710 710 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 + 713 718 scsi_block_requests(vhost->host); 714 719 ibmvfc_set_host_action(vhost, IBMVFC_HOST_ACTION_INIT); 715 720 vhost->job_step = ibmvfc_npiv_login; ··· 3240 3235 /* We need to re-setup the interpartition connection */ 3241 3236 dev_info(vhost->dev, "Partition migrated, Re-enabling adapter\n"); 3242 3237 vhost->client_migrated = 1; 3238 + 3239 + scsi_block_requests(vhost->host); 3243 3240 ibmvfc_purge_requests(vhost, DID_REQUEUE); 3244 - ibmvfc_link_down(vhost, IBMVFC_LINK_DOWN); 3241 + ibmvfc_set_host_state(vhost, IBMVFC_LINK_DOWN); 3245 3242 ibmvfc_set_host_action(vhost, IBMVFC_HOST_ACTION_REENABLE); 3243 + wake_up(&vhost->work_wait_q); 3246 3244 } else if (crq->format == IBMVFC_PARTNER_FAILED || crq->format == IBMVFC_PARTNER_DEREGISTER) { 3247 3245 dev_err(vhost->dev, "Host partner adapter deregistered or failed (rc=%d)\n", crq->format); 3248 3246 ibmvfc_purge_requests(vhost, DID_ERROR);
+7
drivers/scsi/scsi_debug.c
··· 1899 1899 arr[14] |= 0x40; 1900 1900 } 1901 1901 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 + 1902 1909 arr[15] = sdebug_lowest_aligned & 0xff; 1903 1910 1904 1911 if (have_dif_prot) {
+10 -5
drivers/scsi/scsi_transport_sas.c
··· 722 722 int error; 723 723 724 724 error = device_add(&phy->dev); 725 - if (!error) { 726 - transport_add_device(&phy->dev); 727 - transport_configure_device(&phy->dev); 728 - } 725 + if (error) 726 + return error; 729 727 730 - return error; 728 + error = transport_add_device(&phy->dev); 729 + if (error) { 730 + device_del(&phy->dev); 731 + return error; 732 + } 733 + transport_configure_device(&phy->dev); 734 + 735 + return 0; 731 736 } 732 737 EXPORT_SYMBOL(sas_phy_add); 733 738