aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-03-16 15:51:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-03-16 15:51:50 -0400
commit477558d7e8d82b59a650e193a5651cf25b794dbc (patch)
tree8b02c88e577516470222e85312f9a9297c68ec8e /drivers/target
parent11efae3506d882a8782bc89493a32e467defd6b9 (diff)
parent52eaa798f4f4e983c711eaa1c13d8859a52946e8 (diff)
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull more SCSI updates from James Bottomley: "This is the final round of mostly small fixes and performance improvements to our initial submit. The main regression fix is the ia64 simscsi build failure which was missed in the serial number elimination conversion" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (24 commits) scsi: ia64: simscsi: use request tag instead of serial_number scsi: aacraid: Fix performance issue on logical drives scsi: lpfc: Fix error codes in lpfc_sli4_pci_mem_setup() scsi: libiscsi: Hold back_lock when calling iscsi_complete_task scsi: hisi_sas: Change SERDES_CFG init value to increase reliability of HiLink scsi: hisi_sas: Send HARD RESET to clear the previous affiliation of STP target port scsi: hisi_sas: Set PHY linkrate when disconnected scsi: hisi_sas: print PHY RX errors count for later revision of v3 hw scsi: hisi_sas: Fix a timeout race of driver internal and SMP IO scsi: hisi_sas: Change return variable type in phy_up_v3_hw() scsi: qla2xxx: check for kstrtol() failure scsi: lpfc: fix 32-bit format string warning scsi: lpfc: fix unused variable warning scsi: target: tcmu: Switch to bitmap_zalloc() scsi: libiscsi: fall back to sendmsg for slab pages scsi: qla2xxx: avoid printf format warning scsi: lpfc: resolve static checker warning in lpfc_sli4_hba_unset scsi: lpfc: Correct __lpfc_sli_issue_iocb_s4 lockdep check scsi: ufs: hisi: fix ufs_hba_variant_ops passing scsi: qla2xxx: Fix panic in qla_dfs_tgt_counters_show ...
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_user.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
index 5831e0eecea1..9704b135a7bc 100644
--- a/drivers/target/target_core_user.c
+++ b/drivers/target/target_core_user.c
@@ -1663,7 +1663,7 @@ static void tcmu_dev_kref_release(struct kref *kref)
1663 WARN_ON(!all_expired); 1663 WARN_ON(!all_expired);
1664 1664
1665 tcmu_blocks_release(&udev->data_blocks, 0, udev->dbi_max + 1); 1665 tcmu_blocks_release(&udev->data_blocks, 0, udev->dbi_max + 1);
1666 kfree(udev->data_bitmap); 1666 bitmap_free(udev->data_bitmap);
1667 mutex_unlock(&udev->cmdr_lock); 1667 mutex_unlock(&udev->cmdr_lock);
1668 1668
1669 call_rcu(&dev->rcu_head, tcmu_dev_call_rcu); 1669 call_rcu(&dev->rcu_head, tcmu_dev_call_rcu);
@@ -1794,11 +1794,12 @@ static int tcmu_netlink_event_send(struct tcmu_dev *udev,
1794 1794
1795 ret = genlmsg_multicast_allns(&tcmu_genl_family, skb, 0, 1795 ret = genlmsg_multicast_allns(&tcmu_genl_family, skb, 0,
1796 TCMU_MCGRP_CONFIG, GFP_KERNEL); 1796 TCMU_MCGRP_CONFIG, GFP_KERNEL);
1797 /* We don't care if no one is listening */ 1797
1798 if (ret == -ESRCH) 1798 /* Wait during an add as the listener may not be up yet */
1799 ret = 0; 1799 if (ret == 0 ||
1800 if (!ret) 1800 (ret == -ESRCH && cmd == TCMU_CMD_ADDED_DEVICE))
1801 ret = tcmu_wait_genl_cmd_reply(udev); 1801 return tcmu_wait_genl_cmd_reply(udev);
1802
1802 return ret; 1803 return ret;
1803} 1804}
1804 1805
@@ -1870,9 +1871,7 @@ static int tcmu_configure_device(struct se_device *dev)
1870 info = &udev->uio_info; 1871 info = &udev->uio_info;
1871 1872
1872 mutex_lock(&udev->cmdr_lock); 1873 mutex_lock(&udev->cmdr_lock);
1873 udev->data_bitmap = kcalloc(BITS_TO_LONGS(udev->max_blocks), 1874 udev->data_bitmap = bitmap_zalloc(udev->max_blocks, GFP_KERNEL);
1874 sizeof(unsigned long),
1875 GFP_KERNEL);
1876 mutex_unlock(&udev->cmdr_lock); 1875 mutex_unlock(&udev->cmdr_lock);
1877 if (!udev->data_bitmap) { 1876 if (!udev->data_bitmap) {
1878 ret = -ENOMEM; 1877 ret = -ENOMEM;
@@ -1959,7 +1958,7 @@ err_register:
1959 vfree(udev->mb_addr); 1958 vfree(udev->mb_addr);
1960 udev->mb_addr = NULL; 1959 udev->mb_addr = NULL;
1961err_vzalloc: 1960err_vzalloc:
1962 kfree(udev->data_bitmap); 1961 bitmap_free(udev->data_bitmap);
1963 udev->data_bitmap = NULL; 1962 udev->data_bitmap = NULL;
1964err_bitmap_alloc: 1963err_bitmap_alloc:
1965 kfree(info->name); 1964 kfree(info->name);