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:
"Five minor bug fixes.

The libfc one is a tiny memory leak, the zfcp one is an incorrect user
visible parameter and the rest are on error legs or obscure features"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: 53c700: pass correct "dev" to dma_alloc_attrs()
scsi: bnx2fc: Fix error handling in probe()
scsi: scsi_debug: fix write_same with virtual_gb problem
scsi: libfc: free skb when receiving invalid flogi resp
scsi: zfcp: fix sysfs block queue limit output for max_segment_size

+29 -27
-1
drivers/s390/scsi/zfcp_aux.c
··· 403 403 goto failed; 404 404 405 405 /* report size limit per scatter-gather segment */ 406 - adapter->dma_parms.max_segment_size = ZFCP_QDIO_SBALE_LEN; 407 406 adapter->ccw_device->dev.dma_parms = &adapter->dma_parms; 408 407 409 408 adapter->stat_read_buf_num = FSF_STATUS_READS_RECOM;
+2
drivers/s390/scsi/zfcp_scsi.c
··· 428 428 .max_sectors = (((QDIO_MAX_ELEMENTS_PER_BUFFER - 1) 429 429 * ZFCP_QDIO_MAX_SBALS_PER_REQ) - 2) * 8, 430 430 /* GCD, adjusted later */ 431 + /* report size limit per scatter-gather segment */ 432 + .max_segment_size = ZFCP_QDIO_SBALE_LEN, 431 433 .dma_boundary = ZFCP_QDIO_SBALE_LEN - 1, 432 434 .shost_attrs = zfcp_sysfs_shost_attrs, 433 435 .sdev_attrs = zfcp_sysfs_sdev_attrs,
+1 -1
drivers/scsi/53c700.c
··· 295 295 if(tpnt->sdev_attrs == NULL) 296 296 tpnt->sdev_attrs = NCR_700_dev_attrs; 297 297 298 - memory = dma_alloc_attrs(hostdata->dev, TOTAL_MEM_SIZE, &pScript, 298 + memory = dma_alloc_attrs(dev, TOTAL_MEM_SIZE, &pScript, 299 299 GFP_KERNEL, DMA_ATTR_NON_CONSISTENT); 300 300 if(memory == NULL) { 301 301 printk(KERN_ERR "53c700: Failed to allocate memory for driver, detaching\n");
+2 -2
drivers/scsi/bnx2fc/bnx2fc_io.c
··· 240 240 return NULL; 241 241 } 242 242 243 + cmgr->hba = hba; 243 244 cmgr->free_list = kcalloc(arr_sz, sizeof(*cmgr->free_list), 244 245 GFP_KERNEL); 245 246 if (!cmgr->free_list) { ··· 257 256 goto mem_err; 258 257 } 259 258 260 - cmgr->hba = hba; 261 259 cmgr->cmds = (struct bnx2fc_cmd **)(cmgr + 1); 262 260 263 261 for (i = 0; i < arr_sz; i++) { ··· 295 295 296 296 /* Allocate pool of io_bdts - one for each bnx2fc_cmd */ 297 297 mem_size = num_ios * sizeof(struct io_bdt *); 298 - cmgr->io_bdt_pool = kmalloc(mem_size, GFP_KERNEL); 298 + cmgr->io_bdt_pool = kzalloc(mem_size, GFP_KERNEL); 299 299 if (!cmgr->io_bdt_pool) { 300 300 printk(KERN_ERR PFX "failed to alloc io_bdt_pool\n"); 301 301 goto mem_err;
+3 -3
drivers/scsi/libfc/fc_lport.c
··· 1726 1726 fc_frame_payload_op(fp) != ELS_LS_ACC) { 1727 1727 FC_LPORT_DBG(lport, "FLOGI not accepted or bad response\n"); 1728 1728 fc_lport_error(lport, fp); 1729 - goto err; 1729 + goto out; 1730 1730 } 1731 1731 1732 1732 flp = fc_frame_payload_get(fp, sizeof(*flp)); 1733 1733 if (!flp) { 1734 1734 FC_LPORT_DBG(lport, "FLOGI bad response\n"); 1735 1735 fc_lport_error(lport, fp); 1736 - goto err; 1736 + goto out; 1737 1737 } 1738 1738 1739 1739 mfs = ntohs(flp->fl_csp.sp_bb_data) & ··· 1743 1743 FC_LPORT_DBG(lport, "FLOGI bad mfs:%hu response, " 1744 1744 "lport->mfs:%hu\n", mfs, lport->mfs); 1745 1745 fc_lport_error(lport, fp); 1746 - goto err; 1746 + goto out; 1747 1747 } 1748 1748 1749 1749 if (mfs <= lport->mfs) {
+21 -20
drivers/scsi/scsi_debug.c
··· 62 62 63 63 /* make sure inq_product_rev string corresponds to this version */ 64 64 #define SDEBUG_VERSION "0188" /* format to fit INQUIRY revision field */ 65 - static const char *sdebug_version_date = "20180128"; 65 + static const char *sdebug_version_date = "20190125"; 66 66 67 67 #define MY_NAME "scsi_debug" 68 68 ··· 735 735 (sdebug_lbpu || sdebug_lbpws || sdebug_lbpws10); 736 736 } 737 737 738 - static void *fake_store(unsigned long long lba) 738 + static void *lba2fake_store(unsigned long long lba) 739 739 { 740 740 lba = do_div(lba, sdebug_store_sectors); 741 741 ··· 2514 2514 return ret; 2515 2515 } 2516 2516 2517 - /* If fake_store(lba,num) compares equal to arr(num), then copy top half of 2518 - * arr into fake_store(lba,num) and return true. If comparison fails then 2517 + /* If lba2fake_store(lba,num) compares equal to arr(num), then copy top half of 2518 + * arr into lba2fake_store(lba,num) and return true. If comparison fails then 2519 2519 * return false. */ 2520 2520 static bool comp_write_worker(u64 lba, u32 num, const u8 *arr) 2521 2521 { ··· 2643 2643 if (sdt->app_tag == cpu_to_be16(0xffff)) 2644 2644 continue; 2645 2645 2646 - ret = dif_verify(sdt, fake_store(sector), sector, ei_lba); 2646 + ret = dif_verify(sdt, lba2fake_store(sector), sector, ei_lba); 2647 2647 if (ret) { 2648 2648 dif_errors++; 2649 2649 return ret; ··· 3261 3261 static int resp_write_same(struct scsi_cmnd *scp, u64 lba, u32 num, 3262 3262 u32 ei_lba, bool unmap, bool ndob) 3263 3263 { 3264 + int ret; 3264 3265 unsigned long iflags; 3265 3266 unsigned long long i; 3266 - int ret; 3267 - u64 lba_off; 3267 + u32 lb_size = sdebug_sector_size; 3268 + u64 block, lbaa; 3269 + u8 *fs1p; 3268 3270 3269 3271 ret = check_device_access_params(scp, lba, num); 3270 3272 if (ret) ··· 3278 3276 unmap_region(lba, num); 3279 3277 goto out; 3280 3278 } 3281 - 3282 - lba_off = lba * sdebug_sector_size; 3279 + lbaa = lba; 3280 + block = do_div(lbaa, sdebug_store_sectors); 3283 3281 /* if ndob then zero 1 logical block, else fetch 1 logical block */ 3282 + fs1p = fake_storep + (block * lb_size); 3284 3283 if (ndob) { 3285 - memset(fake_storep + lba_off, 0, sdebug_sector_size); 3284 + memset(fs1p, 0, lb_size); 3286 3285 ret = 0; 3287 3286 } else 3288 - ret = fetch_to_dev_buffer(scp, fake_storep + lba_off, 3289 - sdebug_sector_size); 3287 + ret = fetch_to_dev_buffer(scp, fs1p, lb_size); 3290 3288 3291 3289 if (-1 == ret) { 3292 3290 write_unlock_irqrestore(&atomic_rw, iflags); 3293 3291 return DID_ERROR << 16; 3294 - } else if (sdebug_verbose && !ndob && (ret < sdebug_sector_size)) 3292 + } else if (sdebug_verbose && !ndob && (ret < lb_size)) 3295 3293 sdev_printk(KERN_INFO, scp->device, 3296 3294 "%s: %s: lb size=%u, IO sent=%d bytes\n", 3297 - my_name, "write same", 3298 - sdebug_sector_size, ret); 3295 + my_name, "write same", lb_size, ret); 3299 3296 3300 3297 /* Copy first sector to remaining blocks */ 3301 - for (i = 1 ; i < num ; i++) 3302 - memcpy(fake_storep + ((lba + i) * sdebug_sector_size), 3303 - fake_storep + lba_off, 3304 - sdebug_sector_size); 3305 - 3298 + for (i = 1 ; i < num ; i++) { 3299 + lbaa = lba + i; 3300 + block = do_div(lbaa, sdebug_store_sectors); 3301 + memmove(fake_storep + (block * lb_size), fs1p, lb_size); 3302 + } 3306 3303 if (scsi_debug_lbp()) 3307 3304 map_region(lba, num); 3308 3305 out: