Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull SCSI fixes from James Bottomley:
"Thirteen small fixes: The hopefully final effort to get the lpfc nvme
kconfig problems sorted, there's one important sg fix (user can induce
read after end of buffer) and one minor enhancement (adding an extra
PCI ID to qedi). The rest are a set of minor fixes, which mostly occur
as user visible in error legs or on specific devices"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: ufs: remove the duplicated checking for supporting clkscaling
scsi: lpfc: fix building without debugfs support
scsi: lpfc: Fix PT2PT PRLI reject
scsi: hpsa: fix volume offline state
scsi: libsas: fix ata xfer length
scsi: scsi_dh_alua: Warn if the first argument of alua_rtpg_queue() is NULL
scsi: scsi_dh_alua: Ensure that alua_activate() calls the completion function
scsi: scsi_dh_alua: Check scsi_device_get() return value
scsi: sg: check length passed to SG_NEXT_CMD_LEN
scsi: ufshcd-platform: remove the useless cast in ERR_PTR/IS_ERR
scsi: qedi: Add PCI device-ID for QL41xxx adapters.
scsi: aacraid: Fix potential null access
scsi: qla2xxx: Fix crash in qla2xxx_eh_abort on bad ptr

+57 -39
+6 -8
drivers/scsi/aacraid/commsup.c
··· 2056 2056 { 2057 2057 struct hw_fib **hw_fib_p; 2058 2058 struct fib **fib_p; 2059 - int rcode = 1; 2060 2059 2061 2060 hw_fib_p = hw_fib_pool; 2062 2061 fib_p = fib_pool; ··· 2073 2074 } 2074 2075 } 2075 2076 2077 + /* 2078 + * Get the actual number of allocated fibs 2079 + */ 2076 2080 num = hw_fib_p - hw_fib_pool; 2077 - if (!num) 2078 - rcode = 0; 2079 - 2080 - return rcode; 2081 + return num; 2081 2082 } 2082 2083 2083 2084 static void wakeup_fibctx_threads(struct aac_dev *dev, ··· 2185 2186 struct fib *fib; 2186 2187 unsigned long flags; 2187 2188 spinlock_t *t_lock; 2188 - unsigned int rcode; 2189 2189 2190 2190 t_lock = dev->queues->queue[HostNormCmdQueue].lock; 2191 2191 spin_lock_irqsave(t_lock, flags); ··· 2267 2269 * Fill up fib pointer pools with actual fibs 2268 2270 * and hw_fibs 2269 2271 */ 2270 - rcode = fillup_pools(dev, hw_fib_pool, fib_pool, num); 2271 - if (!rcode) 2272 + num = fillup_pools(dev, hw_fib_pool, fib_pool, num); 2273 + if (!num) 2272 2274 goto free_mem; 2273 2275 2274 2276 /*
+24 -14
drivers/scsi/device_handler/scsi_dh_alua.c
··· 113 113 #define ALUA_POLICY_SWITCH_ALL 1 114 114 115 115 static void alua_rtpg_work(struct work_struct *work); 116 - static void alua_rtpg_queue(struct alua_port_group *pg, 116 + static bool alua_rtpg_queue(struct alua_port_group *pg, 117 117 struct scsi_device *sdev, 118 118 struct alua_queue_data *qdata, bool force); 119 119 static void alua_check(struct scsi_device *sdev, bool force); ··· 862 862 kref_put(&pg->kref, release_port_group); 863 863 } 864 864 865 - static void alua_rtpg_queue(struct alua_port_group *pg, 865 + /** 866 + * alua_rtpg_queue() - cause RTPG to be submitted asynchronously 867 + * 868 + * Returns true if and only if alua_rtpg_work() will be called asynchronously. 869 + * That function is responsible for calling @qdata->fn(). 870 + */ 871 + static bool alua_rtpg_queue(struct alua_port_group *pg, 866 872 struct scsi_device *sdev, 867 873 struct alua_queue_data *qdata, bool force) 868 874 { ··· 876 870 unsigned long flags; 877 871 struct workqueue_struct *alua_wq = kaluad_wq; 878 872 879 - if (!pg) 880 - return; 873 + if (WARN_ON_ONCE(!pg) || scsi_device_get(sdev)) 874 + return false; 881 875 882 876 spin_lock_irqsave(&pg->lock, flags); 883 877 if (qdata) { ··· 890 884 pg->flags |= ALUA_PG_RUN_RTPG; 891 885 kref_get(&pg->kref); 892 886 pg->rtpg_sdev = sdev; 893 - scsi_device_get(sdev); 894 887 start_queue = 1; 895 888 } else if (!(pg->flags & ALUA_PG_RUN_RTPG) && force) { 896 889 pg->flags |= ALUA_PG_RUN_RTPG; 897 890 /* Do not queue if the worker is already running */ 898 891 if (!(pg->flags & ALUA_PG_RUNNING)) { 899 892 kref_get(&pg->kref); 900 - sdev = NULL; 901 893 start_queue = 1; 902 894 } 903 895 } ··· 904 900 alua_wq = kaluad_sync_wq; 905 901 spin_unlock_irqrestore(&pg->lock, flags); 906 902 907 - if (start_queue && 908 - !queue_delayed_work(alua_wq, &pg->rtpg_work, 909 - msecs_to_jiffies(ALUA_RTPG_DELAY_MSECS))) { 910 - if (sdev) 911 - scsi_device_put(sdev); 912 - kref_put(&pg->kref, release_port_group); 903 + if (start_queue) { 904 + if (queue_delayed_work(alua_wq, &pg->rtpg_work, 905 + msecs_to_jiffies(ALUA_RTPG_DELAY_MSECS))) 906 + sdev = NULL; 907 + else 908 + kref_put(&pg->kref, release_port_group); 913 909 } 910 + if (sdev) 911 + scsi_device_put(sdev); 912 + 913 + return true; 914 914 } 915 915 916 916 /* ··· 1015 1007 mutex_unlock(&h->init_mutex); 1016 1008 goto out; 1017 1009 } 1018 - fn = NULL; 1019 1010 rcu_read_unlock(); 1020 1011 mutex_unlock(&h->init_mutex); 1021 1012 1022 - alua_rtpg_queue(pg, sdev, qdata, true); 1013 + if (alua_rtpg_queue(pg, sdev, qdata, true)) 1014 + fn = NULL; 1015 + else 1016 + err = SCSI_DH_DEV_OFFLINED; 1023 1017 kref_put(&pg->kref, release_port_group); 1024 1018 out: 1025 1019 if (fn)
+1
drivers/scsi/hpsa.c
··· 3885 3885 if (h->fw_support & MISC_FW_RAID_OFFLOAD_BASIC) 3886 3886 hpsa_get_ioaccel_status(h, scsi3addr, this_device); 3887 3887 volume_offline = hpsa_volume_offline(h, scsi3addr); 3888 + this_device->volume_offline = volume_offline; 3888 3889 if (volume_offline == HPSA_LV_FAILED) { 3889 3890 rc = HPSA_LV_FAILED; 3890 3891 dev_err(&h->pdev->dev,
+1 -1
drivers/scsi/libsas/sas_ata.c
··· 221 221 task->num_scatter = qc->n_elem; 222 222 } else { 223 223 for_each_sg(qc->sg, sg, qc->n_elem, si) 224 - xfer += sg->length; 224 + xfer += sg_dma_len(sg); 225 225 226 226 task->total_xfer_len = xfer; 227 227 task->num_scatter = si;
+14 -8
drivers/scsi/lpfc/lpfc_debugfs.h
··· 44 44 /* hbqinfo output buffer size */ 45 45 #define LPFC_HBQINFO_SIZE 8192 46 46 47 - enum { 48 - DUMP_FCP, 49 - DUMP_NVME, 50 - DUMP_MBX, 51 - DUMP_ELS, 52 - DUMP_NVMELS, 53 - }; 54 - 55 47 /* nvmestat output buffer size */ 56 48 #define LPFC_NVMESTAT_SIZE 8192 57 49 #define LPFC_NVMEKTIME_SIZE 8192 ··· 275 283 struct lpfc_idiag_offset offset; 276 284 void *ptr_private; 277 285 }; 286 + 287 + #else 288 + 289 + #define lpfc_nvmeio_data(phba, fmt, arg...) \ 290 + no_printk(fmt, ##arg) 291 + 278 292 #endif 293 + 294 + enum { 295 + DUMP_FCP, 296 + DUMP_NVME, 297 + DUMP_MBX, 298 + DUMP_ELS, 299 + DUMP_NVMELS, 300 + }; 279 301 280 302 /* Mask for discovery_trace */ 281 303 #define LPFC_DISC_TRC_ELS_CMD 0x1 /* Trace ELS commands */
+2 -1
drivers/scsi/lpfc/lpfc_els.c
··· 7968 7968 did, vport->port_state, ndlp->nlp_flag); 7969 7969 7970 7970 phba->fc_stat.elsRcvPRLI++; 7971 - if (vport->port_state < LPFC_DISC_AUTH) { 7971 + if ((vport->port_state < LPFC_DISC_AUTH) && 7972 + (vport->fc_flag & FC_FABRIC)) { 7972 7973 rjt_err = LSRJT_UNABLE_TPC; 7973 7974 rjt_exp = LSEXP_NOTHING_MORE; 7974 7975 break;
+2 -2
drivers/scsi/lpfc/lpfc_nvmet.c
··· 520 520 struct lpfc_hba *phba = ctxp->phba; 521 521 struct lpfc_iocbq *nvmewqeq; 522 522 unsigned long iflags; 523 - int rc, id; 523 + int rc; 524 524 525 525 #ifdef CONFIG_SCSI_LPFC_DEBUG_FS 526 526 if (phba->ktime_on) { ··· 530 530 ctxp->ts_nvme_data = ktime_get_ns(); 531 531 } 532 532 if (phba->cpucheck_on & LPFC_CHECK_NVMET_IO) { 533 - id = smp_processor_id(); 533 + int id = smp_processor_id(); 534 534 ctxp->cpu = id; 535 535 if (id < LPFC_CHECK_CPU_CNT) 536 536 phba->cpucheck_xmt_io[id]++;
+1
drivers/scsi/qedi/qedi_main.c
··· 2007 2007 2008 2008 static struct pci_device_id qedi_pci_tbl[] = { 2009 2009 { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, 0x165E) }, 2010 + { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, 0x8084) }, 2010 2011 { 0 }, 2011 2012 }; 2012 2013 MODULE_DEVICE_TABLE(pci, qedi_pci_tbl);
+2 -1
drivers/scsi/qla2xxx/qla_os.c
··· 1651 1651 /* Don't abort commands in adapter during EEH 1652 1652 * recovery as it's not accessible/responding. 1653 1653 */ 1654 - if (GET_CMD_SP(sp) && !ha->flags.eeh_busy) { 1654 + if (GET_CMD_SP(sp) && !ha->flags.eeh_busy && 1655 + (sp->type == SRB_SCSI_CMD)) { 1655 1656 /* Get a reference to the sp and drop the lock. 1656 1657 * The reference ensures this sp->done() call 1657 1658 * - and not the call in qla2xxx_eh_abort() -
+2
drivers/scsi/sg.c
··· 996 996 result = get_user(val, ip); 997 997 if (result) 998 998 return result; 999 + if (val > SG_MAX_CDB_SIZE) 1000 + return -ENOMEM; 999 1001 sfp->next_cmd_len = (val > 0) ? val : 0; 1000 1002 return 0; 1001 1003 case SG_GET_VERSION_NUM:
+2 -2
drivers/scsi/ufs/ufshcd-pltfrm.c
··· 309 309 310 310 mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 311 311 mmio_base = devm_ioremap_resource(dev, mem_res); 312 - if (IS_ERR(*(void **)&mmio_base)) { 313 - err = PTR_ERR(*(void **)&mmio_base); 312 + if (IS_ERR(mmio_base)) { 313 + err = PTR_ERR(mmio_base); 314 314 goto out; 315 315 } 316 316
-2
drivers/scsi/ufs/ufshcd.c
··· 4662 4662 } 4663 4663 if (ufshcd_is_clkscaling_supported(hba)) 4664 4664 hba->clk_scaling.active_reqs--; 4665 - if (ufshcd_is_clkscaling_supported(hba)) 4666 - hba->clk_scaling.active_reqs--; 4667 4665 } 4668 4666 4669 4667 /* clear corresponding bits of completed commands */