Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
"Four small fixes: three in drivers and one in the core.

The core fix is also minor in scope since the bug it fixes is only
known to affect systems using SCSI reservations. Of the driver bugs,
the libsas one is the most major because it can lead to multiple disks
on the same expander not being exposed"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: core: reset host byte in DID_NEXUS_FAILURE case
scsi: libsas: Fix rphy phy_identifier for PHYs with end devices attached
scsi: sd_zbc: Fix sd_zbc_report_zones() buffer allocation
scsi: libiscsi: Fix race between iscsi_xmit_task and iscsi_complete_task

Changed files
+14 -3
drivers
+6
drivers/scsi/libiscsi.c
··· 1459 1459 if (test_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx)) 1460 1460 return -ENODATA; 1461 1461 1462 + spin_lock_bh(&conn->session->back_lock); 1463 + if (conn->task == NULL) { 1464 + spin_unlock_bh(&conn->session->back_lock); 1465 + return -ENODATA; 1466 + } 1462 1467 __iscsi_get_task(task); 1468 + spin_unlock_bh(&conn->session->back_lock); 1463 1469 spin_unlock_bh(&conn->session->frwd_lock); 1464 1470 rc = conn->session->tt->xmit_task(task); 1465 1471 spin_lock_bh(&conn->session->frwd_lock);
+2
drivers/scsi/libsas/sas_expander.c
··· 828 828 rphy = sas_end_device_alloc(phy->port); 829 829 if (!rphy) 830 830 goto out_free; 831 + rphy->identify.phy_identifier = phy_id; 831 832 832 833 child->rphy = rphy; 833 834 get_device(&rphy->dev); ··· 855 854 856 855 child->rphy = rphy; 857 856 get_device(&rphy->dev); 857 + rphy->identify.phy_identifier = phy_id; 858 858 sas_fill_in_rphy(child, rphy); 859 859 860 860 list_add_tail(&child->disco_list_node, &parent->port->disco_list);
+1
drivers/scsi/scsi_lib.c
··· 655 655 set_host_byte(cmd, DID_OK); 656 656 return BLK_STS_TARGET; 657 657 case DID_NEXUS_FAILURE: 658 + set_host_byte(cmd, DID_OK); 658 659 return BLK_STS_NEXUS; 659 660 case DID_ALLOC_FAILURE: 660 661 set_host_byte(cmd, DID_OK);
+5 -3
drivers/scsi/sd_zbc.c
··· 142 142 return -EOPNOTSUPP; 143 143 144 144 /* 145 - * Get a reply buffer for the number of requested zones plus a header. 146 - * For ATA, buffers must be aligned to 512B. 145 + * Get a reply buffer for the number of requested zones plus a header, 146 + * without exceeding the device maximum command size. For ATA disks, 147 + * buffers must be aligned to 512B. 147 148 */ 148 - buflen = roundup((nrz + 1) * 64, 512); 149 + buflen = min(queue_max_hw_sectors(disk->queue) << 9, 150 + roundup((nrz + 1) * 64, 512)); 149 151 buf = kmalloc(buflen, gfp_mask); 150 152 if (!buf) 151 153 return -ENOMEM;