aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-02-23 12:48:01 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2019-02-23 12:48:01 -0500
commit6089a91fc02e0a4f8962f0df1be236c44248d7ea (patch)
treed08367d429256eb026679e6c5ca762fbd2589d14 /drivers
parentcb268d806972c76c34e5d74343fb6064cd722c7c (diff)
parent4a067cf823d9d8e50d41cfb618011c0d4a969c72 (diff)
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
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/libiscsi.c6
-rw-r--r--drivers/scsi/libsas/sas_expander.c2
-rw-r--r--drivers/scsi/scsi_lib.c1
-rw-r--r--drivers/scsi/sd_zbc.c8
4 files changed, 14 insertions, 3 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index b8d325ce8754..120fc520f27a 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1459,7 +1459,13 @@ static int iscsi_xmit_task(struct iscsi_conn *conn)
1459 if (test_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx)) 1459 if (test_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx))
1460 return -ENODATA; 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 __iscsi_get_task(task); 1467 __iscsi_get_task(task);
1468 spin_unlock_bh(&conn->session->back_lock);
1463 spin_unlock_bh(&conn->session->frwd_lock); 1469 spin_unlock_bh(&conn->session->frwd_lock);
1464 rc = conn->session->tt->xmit_task(task); 1470 rc = conn->session->tt->xmit_task(task);
1465 spin_lock_bh(&conn->session->frwd_lock); 1471 spin_lock_bh(&conn->session->frwd_lock);
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index 17eb4185f29d..f21c93bbb35c 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -828,6 +828,7 @@ static struct domain_device *sas_ex_discover_end_dev(
828 rphy = sas_end_device_alloc(phy->port); 828 rphy = sas_end_device_alloc(phy->port);
829 if (!rphy) 829 if (!rphy)
830 goto out_free; 830 goto out_free;
831 rphy->identify.phy_identifier = phy_id;
831 832
832 child->rphy = rphy; 833 child->rphy = rphy;
833 get_device(&rphy->dev); 834 get_device(&rphy->dev);
@@ -854,6 +855,7 @@ static struct domain_device *sas_ex_discover_end_dev(
854 855
855 child->rphy = rphy; 856 child->rphy = rphy;
856 get_device(&rphy->dev); 857 get_device(&rphy->dev);
858 rphy->identify.phy_identifier = phy_id;
857 sas_fill_in_rphy(child, rphy); 859 sas_fill_in_rphy(child, rphy);
858 860
859 list_add_tail(&child->disco_list_node, &parent->port->disco_list); 861 list_add_tail(&child->disco_list_node, &parent->port->disco_list);
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 6d65ac584eba..f8d51c3d5582 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -655,6 +655,7 @@ static blk_status_t scsi_result_to_blk_status(struct scsi_cmnd *cmd, int result)
655 set_host_byte(cmd, DID_OK); 655 set_host_byte(cmd, DID_OK);
656 return BLK_STS_TARGET; 656 return BLK_STS_TARGET;
657 case DID_NEXUS_FAILURE: 657 case DID_NEXUS_FAILURE:
658 set_host_byte(cmd, DID_OK);
658 return BLK_STS_NEXUS; 659 return BLK_STS_NEXUS;
659 case DID_ALLOC_FAILURE: 660 case DID_ALLOC_FAILURE:
660 set_host_byte(cmd, DID_OK); 661 set_host_byte(cmd, DID_OK);
diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c
index fff86940388b..a340af797a85 100644
--- a/drivers/scsi/sd_zbc.c
+++ b/drivers/scsi/sd_zbc.c
@@ -142,10 +142,12 @@ int sd_zbc_report_zones(struct gendisk *disk, sector_t sector,
142 return -EOPNOTSUPP; 142 return -EOPNOTSUPP;
143 143
144 /* 144 /*
145 * Get a reply buffer for the number of requested zones plus a header. 145 * Get a reply buffer for the number of requested zones plus a header,
146 * For ATA, buffers must be aligned to 512B. 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 buf = kmalloc(buflen, gfp_mask); 151 buf = kmalloc(buflen, gfp_mask);
150 if (!buf) 152 if (!buf)
151 return -ENOMEM; 153 return -ENOMEM;