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:
"This is a set of minor (and safe changes) that didn't make the initial
pull request plus some bug fixes.

The status handling code is actually a running regression from the
previous merge window which had an incomplete fix (now reverted) and
most of the remaining bug fixes are for problems older than the
current merge window"

[ Side note: this merge also takes the base kernel git repository to 6+
million objects for the first time. Technically we hit it a couple of
merges ago already if you count all the tag objects, but now it
reaches 6M+ objects reachable from HEAD.

I was joking around that that's when I should switch to 5.0, because
3.0 happened at the 2M mark, and 4.0 happened at 4M objects. But
probably not, even if numerology is about as good a reason as any.

- Linus ]

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: devinfo: Add Microsoft iSCSI target to 1024 sector blacklist
scsi: cxgb4i: silence overflow warning in t4_uld_rx_handler()
scsi: dpt_i2o: Use after free in I2ORESETCMD ioctl
scsi: core: Make scsi_result_to_blk_status() recognize CONDITION MET
scsi: core: Rename __scsi_error_from_host_byte() into scsi_result_to_blk_status()
Revert "scsi: core: return BLK_STS_OK for DID_OK in __scsi_error_from_host_byte()"
scsi: aacraid: Insure command thread is not recursively stopped
scsi: qla2xxx: Correct setting of SAM_STAT_CHECK_CONDITION
scsi: qla2xxx: correctly shift host byte
scsi: qla2xxx: Fix race condition between iocb timeout and initialisation
scsi: qla2xxx: Avoid double completion of abort command
scsi: qla2xxx: Fix small memory leak in qla2x00_probe_one on probe failure
scsi: scsi_dh: Don't look for NULL devices handlers by name
scsi: core: remove redundant assignment to shost->use_blk_mq

+109 -82
+3 -1
drivers/scsi/aacraid/commsup.c
··· 1502 1502 host = aac->scsi_host_ptr; 1503 1503 scsi_block_requests(host); 1504 1504 aac_adapter_disable_int(aac); 1505 - if (aac->thread->pid != current->pid) { 1505 + if (aac->thread && aac->thread->pid != current->pid) { 1506 1506 spin_unlock_irq(host->host_lock); 1507 1507 kthread_stop(aac->thread); 1508 + aac->thread = NULL; 1508 1509 jafo = 1; 1509 1510 } 1510 1511 ··· 1592 1591 aac->name); 1593 1592 if (IS_ERR(aac->thread)) { 1594 1593 retval = PTR_ERR(aac->thread); 1594 + aac->thread = NULL; 1595 1595 goto out; 1596 1596 } 1597 1597 }
+1
drivers/scsi/aacraid/linit.c
··· 1562 1562 up(&fib->event_wait); 1563 1563 } 1564 1564 kthread_stop(aac->thread); 1565 + aac->thread = NULL; 1565 1566 } 1566 1567 1567 1568 aac_send_shutdown(aac);
+4 -4
drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
··· 2108 2108 log_debug(1 << CXGBI_DBG_TOE, 2109 2109 "cdev %p, opcode 0x%x(0x%x,0x%x), skb %p.\n", 2110 2110 cdev, opc, rpl->ot.opcode_tid, ntohl(rpl->ot.opcode_tid), skb); 2111 - if (cxgb4i_cplhandlers[opc]) 2112 - cxgb4i_cplhandlers[opc](cdev, skb); 2113 - else { 2111 + if (opc >= ARRAY_SIZE(cxgb4i_cplhandlers) || !cxgb4i_cplhandlers[opc]) { 2114 2112 pr_err("No handler for opcode 0x%x.\n", opc); 2115 2113 __kfree_skb(skb); 2116 - } 2114 + } else 2115 + cxgb4i_cplhandlers[opc](cdev, skb); 2116 + 2117 2117 return 0; 2118 2118 nomem: 2119 2119 log_debug(1 << CXGBI_DBG_TOE, "OOM bailing out.\n");
+8 -5
drivers/scsi/dpt_i2o.c
··· 2051 2051 } 2052 2052 break; 2053 2053 } 2054 - case I2ORESETCMD: 2055 - if(pHba->host) 2056 - spin_lock_irqsave(pHba->host->host_lock, flags); 2054 + case I2ORESETCMD: { 2055 + struct Scsi_Host *shost = pHba->host; 2056 + 2057 + if (shost) 2058 + spin_lock_irqsave(shost->host_lock, flags); 2057 2059 adpt_hba_reset(pHba); 2058 - if(pHba->host) 2059 - spin_unlock_irqrestore(pHba->host->host_lock, flags); 2060 + if (shost) 2061 + spin_unlock_irqrestore(shost->host_lock, flags); 2060 2062 break; 2063 + } 2061 2064 case I2ORESCANCMD: 2062 2065 adpt_rescan(pHba); 2063 2066 break;
-1
drivers/scsi/hosts.c
··· 472 472 else 473 473 shost->dma_boundary = 0xffffffff; 474 474 475 - shost->use_blk_mq = scsi_use_blk_mq; 476 475 shost->use_blk_mq = scsi_use_blk_mq || shost->hostt->force_blk_mq; 477 476 478 477 device_initialize(&shost->shost_gendev);
+7 -5
drivers/scsi/qla2xxx/qla_gs.c
··· 3794 3794 sp->gen1 = fcport->rscn_gen; 3795 3795 sp->gen2 = fcport->login_gen; 3796 3796 3797 + sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; 3797 3798 qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); 3798 3799 3799 3800 /* CT_IU preamble */ ··· 3813 3812 sp->u.iocb_cmd.u.ctarg.rsp_size = GFF_ID_RSP_SIZE; 3814 3813 sp->u.iocb_cmd.u.ctarg.nport_handle = NPH_SNS; 3815 3814 3816 - sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; 3817 3815 sp->done = qla24xx_async_gffid_sp_done; 3818 3816 3819 3817 rval = qla2x00_start_sp(sp); ··· 4230 4230 sp->name = "gnnft"; 4231 4231 sp->gen1 = vha->hw->base_qpair->chip_reset; 4232 4232 sp->gen2 = fc4_type; 4233 + 4234 + sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; 4233 4235 qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); 4234 4236 4235 4237 memset(sp->u.iocb_cmd.u.ctarg.rsp, 0, sp->u.iocb_cmd.u.ctarg.rsp_size); ··· 4248 4246 sp->u.iocb_cmd.u.ctarg.req_size = GNN_FT_REQ_SIZE; 4249 4247 sp->u.iocb_cmd.u.ctarg.nport_handle = NPH_SNS; 4250 4248 4251 - sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; 4252 4249 sp->done = qla2x00_async_gpnft_gnnft_sp_done; 4253 4250 4254 4251 rval = qla2x00_start_sp(sp); ··· 4371 4370 sp->name = "gpnft"; 4372 4371 sp->gen1 = vha->hw->base_qpair->chip_reset; 4373 4372 sp->gen2 = fc4_type; 4373 + 4374 + sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; 4374 4375 qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); 4375 4376 4376 4377 rspsz = sizeof(struct ct_sns_gpnft_rsp) + ··· 4388 4385 4389 4386 sp->u.iocb_cmd.u.ctarg.nport_handle = NPH_SNS; 4390 4387 4391 - sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; 4392 4388 sp->done = qla2x00_async_gpnft_gnnft_sp_done; 4393 4389 4394 4390 rval = qla2x00_start_sp(sp); ··· 4497 4495 sp->gen1 = fcport->rscn_gen; 4498 4496 sp->gen2 = fcport->login_gen; 4499 4497 4498 + sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; 4500 4499 qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); 4501 4500 4502 4501 /* CT_IU preamble */ ··· 4519 4516 sp->u.iocb_cmd.u.ctarg.rsp_size = GNN_ID_RSP_SIZE; 4520 4517 sp->u.iocb_cmd.u.ctarg.nport_handle = NPH_SNS; 4521 4518 4522 - sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; 4523 4519 sp->done = qla2x00_async_gnnid_sp_done; 4524 4520 4525 4521 rval = qla2x00_start_sp(sp); ··· 4634 4632 sp->gen1 = fcport->rscn_gen; 4635 4633 sp->gen2 = fcport->login_gen; 4636 4634 4635 + sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; 4637 4636 qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); 4638 4637 4639 4638 /* CT_IU preamble */ ··· 4656 4653 sp->u.iocb_cmd.u.ctarg.rsp_size = GFPN_ID_RSP_SIZE; 4657 4654 sp->u.iocb_cmd.u.ctarg.nport_handle = NPH_SNS; 4658 4655 4659 - sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; 4660 4656 sp->done = qla2x00_async_gfpnid_sp_done; 4661 4657 4662 4658 rval = qla2x00_start_sp(sp);
+25 -16
drivers/scsi/qla2xxx/qla_init.c
··· 183 183 sp->name = "login"; 184 184 sp->gen1 = fcport->rscn_gen; 185 185 sp->gen2 = fcport->login_gen; 186 - qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); 187 186 188 187 lio = &sp->u.iocb_cmd; 189 188 lio->timeout = qla2x00_async_iocb_timeout; 189 + qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); 190 + 190 191 sp->done = qla2x00_async_login_sp_done; 191 192 lio->u.logio.flags |= SRB_LOGIN_COND_PLOGI; 192 193 ··· 246 245 247 246 sp->type = SRB_LOGOUT_CMD; 248 247 sp->name = "logout"; 249 - qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); 250 248 251 249 lio = &sp->u.iocb_cmd; 252 250 lio->timeout = qla2x00_async_iocb_timeout; 251 + qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); 252 + 253 253 sp->done = qla2x00_async_logout_sp_done; 254 254 rval = qla2x00_start_sp(sp); 255 255 if (rval != QLA_SUCCESS) ··· 309 307 310 308 sp->type = SRB_PRLO_CMD; 311 309 sp->name = "prlo"; 312 - qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); 313 310 314 311 lio = &sp->u.iocb_cmd; 315 312 lio->timeout = qla2x00_async_iocb_timeout; 313 + qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); 314 + 316 315 sp->done = qla2x00_async_prlo_sp_done; 317 316 rval = qla2x00_start_sp(sp); 318 317 if (rval != QLA_SUCCESS) ··· 415 412 416 413 sp->type = SRB_ADISC_CMD; 417 414 sp->name = "adisc"; 418 - qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); 419 415 420 416 lio = &sp->u.iocb_cmd; 421 417 lio->timeout = qla2x00_async_iocb_timeout; 418 + qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); 419 + 422 420 sp->done = qla2x00_async_adisc_sp_done; 423 421 if (data[1] & QLA_LOGIO_LOGIN_RETRIED) 424 422 lio->u.logio.flags |= SRB_LOGIN_RETRIED; ··· 749 745 sp->gen1 = fcport->rscn_gen; 750 746 sp->gen2 = fcport->login_gen; 751 747 748 + mbx = &sp->u.iocb_cmd; 749 + mbx->timeout = qla2x00_async_iocb_timeout; 752 750 qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha)+2); 753 751 754 752 mb = sp->u.iocb_cmd.u.mbx.out_mb; ··· 762 756 mb[7] = LSW(MSD(vha->gnl.ldma)); 763 757 mb[8] = vha->gnl.size; 764 758 mb[9] = vha->vp_idx; 765 - 766 - mbx = &sp->u.iocb_cmd; 767 - mbx->timeout = qla2x00_async_iocb_timeout; 768 759 769 760 sp->done = qla24xx_async_gnl_sp_done; 770 761 ··· 890 887 891 888 sp->type = SRB_PRLI_CMD; 892 889 sp->name = "prli"; 893 - qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); 894 890 895 891 lio = &sp->u.iocb_cmd; 896 892 lio->timeout = qla2x00_async_iocb_timeout; 893 + qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); 894 + 897 895 sp->done = qla2x00_async_prli_sp_done; 898 896 lio->u.logio.flags = 0; 899 897 ··· 959 955 sp->name = "gpdb"; 960 956 sp->gen1 = fcport->rscn_gen; 961 957 sp->gen2 = fcport->login_gen; 958 + 959 + mbx = &sp->u.iocb_cmd; 960 + mbx->timeout = qla2x00_async_iocb_timeout; 962 961 qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); 963 962 964 963 pd = dma_pool_zalloc(ha->s_dma_pool, GFP_KERNEL, &pd_dma); ··· 981 974 mb[9] = vha->vp_idx; 982 975 mb[10] = opt; 983 976 984 - mbx = &sp->u.iocb_cmd; 985 - mbx->timeout = qla2x00_async_iocb_timeout; 986 977 mbx->u.mbx.in = (void *)pd; 987 978 mbx->u.mbx.in_dma = pd_dma; 988 979 ··· 1495 1490 tm_iocb = &sp->u.iocb_cmd; 1496 1491 sp->type = SRB_TM_CMD; 1497 1492 sp->name = "tmf"; 1493 + 1494 + tm_iocb->timeout = qla2x00_tmf_iocb_timeout; 1495 + init_completion(&tm_iocb->u.tmf.comp); 1498 1496 qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha)); 1497 + 1499 1498 tm_iocb->u.tmf.flags = flags; 1500 1499 tm_iocb->u.tmf.lun = lun; 1501 1500 tm_iocb->u.tmf.data = tag; 1502 1501 sp->done = qla2x00_tmf_sp_done; 1503 - tm_iocb->timeout = qla2x00_tmf_iocb_timeout; 1504 - init_completion(&tm_iocb->u.tmf.comp); 1505 1502 1506 1503 rval = qla2x00_start_sp(sp); 1507 1504 if (rval != QLA_SUCCESS) ··· 1557 1550 srb_t *sp = ptr; 1558 1551 struct srb_iocb *abt = &sp->u.iocb_cmd; 1559 1552 1560 - del_timer(&sp->u.iocb_cmd.timer); 1561 - complete(&abt->u.abt.comp); 1553 + if (del_timer(&sp->u.iocb_cmd.timer)) 1554 + complete(&abt->u.abt.comp); 1562 1555 } 1563 1556 1564 1557 int ··· 1577 1570 abt_iocb = &sp->u.iocb_cmd; 1578 1571 sp->type = SRB_ABT_CMD; 1579 1572 sp->name = "abort"; 1573 + 1574 + abt_iocb->timeout = qla24xx_abort_iocb_timeout; 1575 + init_completion(&abt_iocb->u.abt.comp); 1580 1576 qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha)); 1577 + 1581 1578 abt_iocb->u.abt.cmd_hndl = cmd_sp->handle; 1582 1579 1583 1580 if (vha->flags.qpairs_available && cmd_sp->qpair) ··· 1591 1580 abt_iocb->u.abt.req_que_no = cpu_to_le16(vha->req->id); 1592 1581 1593 1582 sp->done = qla24xx_abort_sp_done; 1594 - abt_iocb->timeout = qla24xx_abort_iocb_timeout; 1595 - init_completion(&abt_iocb->u.abt.comp); 1596 1583 1597 1584 rval = qla2x00_start_sp(sp); 1598 1585 if (rval != QLA_SUCCESS)
+1 -1
drivers/scsi/qla2xxx/qla_inline.h
··· 272 272 { 273 273 timer_setup(&sp->u.iocb_cmd.timer, qla2x00_sp_timeout, 0); 274 274 sp->u.iocb_cmd.timer.expires = jiffies + tmo * HZ; 275 - add_timer(&sp->u.iocb_cmd.timer); 276 275 sp->free = qla2x00_sp_free; 277 276 init_completion(&sp->comp); 278 277 if (IS_QLAFX00(sp->vha->hw) && (sp->type == SRB_FXIOCB_DCMD)) 279 278 init_completion(&sp->u.iocb_cmd.u.fxiocb.fxiocb_comp); 280 279 if (sp->type == SRB_ELS_DCMD) 281 280 init_completion(&sp->u.iocb_cmd.u.els_logo.comp); 281 + add_timer(&sp->u.iocb_cmd.timer); 282 282 } 283 283 284 284 static inline int
+5 -3
drivers/scsi/qla2xxx/qla_iocb.c
··· 2460 2460 sp->type = SRB_ELS_DCMD; 2461 2461 sp->name = "ELS_DCMD"; 2462 2462 sp->fcport = fcport; 2463 - qla2x00_init_timer(sp, ELS_DCMD_TIMEOUT); 2464 2463 elsio->timeout = qla2x00_els_dcmd_iocb_timeout; 2464 + qla2x00_init_timer(sp, ELS_DCMD_TIMEOUT); 2465 2465 sp->done = qla2x00_els_dcmd_sp_done; 2466 2466 sp->free = qla2x00_els_dcmd_sp_free; 2467 2467 ··· 2658 2658 sp->type = SRB_ELS_DCMD; 2659 2659 sp->name = "ELS_DCMD"; 2660 2660 sp->fcport = fcport; 2661 - qla2x00_init_timer(sp, ELS_DCMD_TIMEOUT); 2661 + 2662 2662 elsio->timeout = qla2x00_els_dcmd2_iocb_timeout; 2663 + init_completion(&elsio->u.els_plogi.comp); 2664 + qla2x00_init_timer(sp, ELS_DCMD_TIMEOUT); 2665 + 2663 2666 sp->done = qla2x00_els_dcmd2_sp_done; 2664 2667 sp->free = qla2x00_els_dcmd2_sp_free; 2665 2668 ··· 2699 2696 ql_dump_buffer(ql_dbg_io + ql_dbg_buffer, vha, 0x0109, 2700 2697 (uint8_t *)elsio->u.els_plogi.els_plogi_pyld, 0x70); 2701 2698 2702 - init_completion(&elsio->u.els_plogi.comp); 2703 2699 rval = qla2x00_start_sp(sp); 2704 2700 if (rval != QLA_SUCCESS) { 2705 2701 rval = QLA_FUNCTION_FAILED;
+4 -4
drivers/scsi/qla2xxx/qla_isr.c
··· 2174 2174 0x10, 0x1); 2175 2175 set_driver_byte(cmd, DRIVER_SENSE); 2176 2176 set_host_byte(cmd, DID_ABORT); 2177 - cmd->result |= SAM_STAT_CHECK_CONDITION << 1; 2177 + cmd->result |= SAM_STAT_CHECK_CONDITION; 2178 2178 return 1; 2179 2179 } 2180 2180 ··· 2184 2184 0x10, 0x3); 2185 2185 set_driver_byte(cmd, DRIVER_SENSE); 2186 2186 set_host_byte(cmd, DID_ABORT); 2187 - cmd->result |= SAM_STAT_CHECK_CONDITION << 1; 2187 + cmd->result |= SAM_STAT_CHECK_CONDITION; 2188 2188 return 1; 2189 2189 } 2190 2190 ··· 2194 2194 0x10, 0x2); 2195 2195 set_driver_byte(cmd, DRIVER_SENSE); 2196 2196 set_host_byte(cmd, DID_ABORT); 2197 - cmd->result |= SAM_STAT_CHECK_CONDITION << 1; 2197 + cmd->result |= SAM_STAT_CHECK_CONDITION; 2198 2198 return 1; 2199 2199 } 2200 2200 ··· 2347 2347 bsg_job->reply_len = sizeof(struct fc_bsg_reply); 2348 2348 /* Always return DID_OK, bsg will send the vendor specific response 2349 2349 * in this case only */ 2350 - sp->done(sp, DID_OK << 6); 2350 + sp->done(sp, DID_OK << 16); 2351 2351 2352 2352 } 2353 2353
+4 -4
drivers/scsi/qla2xxx/qla_mbx.c
··· 6023 6023 sp->type = SRB_MB_IOCB; 6024 6024 sp->name = mb_to_str(mcp->mb[0]); 6025 6025 6026 - qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); 6027 - 6028 - memcpy(sp->u.iocb_cmd.u.mbx.out_mb, mcp->mb, SIZEOF_IOCB_MB_REG); 6029 - 6030 6026 c = &sp->u.iocb_cmd; 6031 6027 c->timeout = qla2x00_async_iocb_timeout; 6032 6028 init_completion(&c->u.mbx.comp); 6029 + 6030 + qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); 6031 + 6032 + memcpy(sp->u.iocb_cmd.u.mbx.out_mb, mcp->mb, SIZEOF_IOCB_MB_REG); 6033 6033 6034 6034 sp->done = qla2x00_async_mb_sp_done; 6035 6035
+1 -1
drivers/scsi/qla2xxx/qla_mid.c
··· 929 929 sp->type = SRB_CTRL_VP; 930 930 sp->name = "ctrl_vp"; 931 931 sp->done = qla_ctrlvp_sp_done; 932 - qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); 933 932 sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; 933 + qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); 934 934 sp->u.iocb_cmd.u.ctrlvp.cmd = cmd; 935 935 sp->u.iocb_cmd.u.ctrlvp.vp_index = vp_index; 936 936
+3 -2
drivers/scsi/qla2xxx/qla_mr.c
··· 1821 1821 1822 1822 sp->type = SRB_FXIOCB_DCMD; 1823 1823 sp->name = "fxdisc"; 1824 - qla2x00_init_timer(sp, FXDISC_TIMEOUT); 1825 1824 1826 1825 fdisc = &sp->u.iocb_cmd; 1826 + fdisc->timeout = qla2x00_fxdisc_iocb_timeout; 1827 + qla2x00_init_timer(sp, FXDISC_TIMEOUT); 1828 + 1827 1829 switch (fx_type) { 1828 1830 case FXDISC_GET_CONFIG_INFO: 1829 1831 fdisc->u.fxiocb.flags = ··· 1926 1924 goto done_unmap_req; 1927 1925 } 1928 1926 1929 - fdisc->timeout = qla2x00_fxdisc_iocb_timeout; 1930 1927 fdisc->u.fxiocb.req_func_type = cpu_to_le16(fx_type); 1931 1928 sp->done = qla2x00_fxdisc_sp_done; 1932 1929
+21 -23
drivers/scsi/qla2xxx/qla_os.c
··· 470 470 471 471 static void qla2x00_free_req_que(struct qla_hw_data *ha, struct req_que *req) 472 472 { 473 - if (!ha->req_q_map) 474 - return; 475 - 476 473 if (IS_QLAFX00(ha)) { 477 474 if (req && req->ring_fx00) 478 475 dma_free_coherent(&ha->pdev->dev, ··· 480 483 (req->length + 1) * sizeof(request_t), 481 484 req->ring, req->dma); 482 485 483 - if (req) { 486 + if (req) 484 487 kfree(req->outstanding_cmds); 485 - kfree(req); 486 - } 488 + 489 + kfree(req); 487 490 } 488 491 489 492 static void qla2x00_free_rsp_que(struct qla_hw_data *ha, struct rsp_que *rsp) 490 493 { 491 - if (!ha->rsp_q_map) 492 - return; 493 - 494 494 if (IS_QLAFX00(ha)) { 495 495 if (rsp && rsp->ring_fx00) 496 496 dma_free_coherent(&ha->pdev->dev, ··· 498 504 (rsp->length + 1) * sizeof(response_t), 499 505 rsp->ring, rsp->dma); 500 506 } 501 - if (rsp) 502 - kfree(rsp); 507 + kfree(rsp); 503 508 } 504 509 505 510 static void qla2x00_free_queues(struct qla_hw_data *ha) ··· 3099 3106 goto probe_failed; 3100 3107 3101 3108 /* Alloc arrays of request and response ring ptrs */ 3102 - if (qla2x00_alloc_queues(ha, req, rsp)) { 3109 + ret = qla2x00_alloc_queues(ha, req, rsp); 3110 + if (ret) { 3103 3111 ql_log(ql_log_fatal, base_vha, 0x003d, 3104 3112 "Failed to allocate memory for queue pointers..." 3105 3113 "aborting.\n"); ··· 3401 3407 } 3402 3408 3403 3409 qla2x00_free_device(base_vha); 3404 - 3405 3410 scsi_host_put(base_vha->host); 3411 + /* 3412 + * Need to NULL out local req/rsp after 3413 + * qla2x00_free_device => qla2x00_free_queues frees 3414 + * what these are pointing to. Or else we'll 3415 + * fall over below in qla2x00_free_req/rsp_que. 3416 + */ 3417 + req = NULL; 3418 + rsp = NULL; 3406 3419 3407 3420 probe_hw_failed: 3408 3421 qla2x00_mem_free(ha); ··· 4115 4114 (*rsp)->dma = 0; 4116 4115 fail_rsp_ring: 4117 4116 kfree(*rsp); 4117 + *rsp = NULL; 4118 4118 fail_rsp: 4119 4119 dma_free_coherent(&ha->pdev->dev, ((*req)->length + 1) * 4120 4120 sizeof(request_t), (*req)->ring, (*req)->dma); ··· 4123 4121 (*req)->dma = 0; 4124 4122 fail_req_ring: 4125 4123 kfree(*req); 4124 + *req = NULL; 4126 4125 fail_req: 4127 4126 dma_free_coherent(&ha->pdev->dev, sizeof(struct ct_sns_pkt), 4128 4127 ha->ct_sns, ha->ct_sns_dma); ··· 4511 4508 dma_free_coherent(&ha->pdev->dev, ha->init_cb_size, 4512 4509 ha->init_cb, ha->init_cb_dma); 4513 4510 4514 - if (ha->optrom_buffer) 4515 - vfree(ha->optrom_buffer); 4516 - if (ha->nvram) 4517 - kfree(ha->nvram); 4518 - if (ha->npiv_info) 4519 - kfree(ha->npiv_info); 4520 - if (ha->swl) 4521 - kfree(ha->swl); 4522 - if (ha->loop_id_map) 4523 - kfree(ha->loop_id_map); 4511 + vfree(ha->optrom_buffer); 4512 + kfree(ha->nvram); 4513 + kfree(ha->npiv_info); 4514 + kfree(ha->swl); 4515 + kfree(ha->loop_id_map); 4524 4516 4525 4517 ha->srb_mempool = NULL; 4526 4518 ha->ctx_mempool = NULL;
+1 -1
drivers/scsi/qla2xxx/qla_target.c
··· 664 664 sp->type = type; 665 665 sp->name = "nack"; 666 666 667 + sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; 667 668 qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha)+2); 668 669 669 670 sp->u.iocb_cmd.u.nack.ntfy = ntfy; 670 - sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; 671 671 sp->done = qla2x00_async_nack_sp_done; 672 672 673 673 rval = qla2x00_start_sp(sp);
+1 -1
drivers/scsi/scsi_devinfo.c
··· 202 202 {"Medion", "Flash XL MMC/SD", "2.6D", BLIST_FORCELUN}, 203 203 {"MegaRAID", "LD", NULL, BLIST_FORCELUN}, 204 204 {"MICROP", "4110", NULL, BLIST_NOTQ}, 205 - {"MSFT", "Virtual HD", NULL, BLIST_NO_RSOC}, 205 + {"MSFT", "Virtual HD", NULL, BLIST_MAX_1024 | BLIST_NO_RSOC}, 206 206 {"MYLEX", "DACARMRB", "*", BLIST_REPORTLUN2}, 207 207 {"nCipher", "Fastness Crypto", NULL, BLIST_FORCELUN}, 208 208 {"NAKAMICH", "MJ-4.8S", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
+3
drivers/scsi/scsi_dh.c
··· 112 112 { 113 113 struct scsi_device_handler *dh; 114 114 115 + if (!name || strlen(name) == 0) 116 + return NULL; 117 + 115 118 dh = __scsi_dh_lookup(name); 116 119 if (!dh) { 117 120 request_module("scsi_dh_%s", name);
+17 -10
drivers/scsi/scsi_lib.c
··· 723 723 } 724 724 725 725 /** 726 - * __scsi_error_from_host_byte - translate SCSI error code into errno 727 - * @cmd: SCSI command (unused) 726 + * scsi_result_to_blk_status - translate a SCSI result code into blk_status_t 727 + * @cmd: SCSI command 728 728 * @result: scsi error code 729 729 * 730 - * Translate SCSI error code into block errors. 730 + * Translate a SCSI result code into a blk_status_t value. May reset the host 731 + * byte of @cmd->result. 731 732 */ 732 - static blk_status_t __scsi_error_from_host_byte(struct scsi_cmnd *cmd, 733 - int result) 733 + static blk_status_t scsi_result_to_blk_status(struct scsi_cmnd *cmd, int result) 734 734 { 735 735 switch (host_byte(result)) { 736 736 case DID_OK: 737 - return BLK_STS_OK; 737 + /* 738 + * Also check the other bytes than the status byte in result 739 + * to handle the case when a SCSI LLD sets result to 740 + * DRIVER_SENSE << 24 without setting SAM_STAT_CHECK_CONDITION. 741 + */ 742 + if (scsi_status_is_good(result) && (result & ~0xff) == 0) 743 + return BLK_STS_OK; 744 + return BLK_STS_IOERR; 738 745 case DID_TRANSPORT_FAILFAST: 739 746 return BLK_STS_TRANSPORT; 740 747 case DID_TARGET_FAILURE: ··· 819 812 SCSI_SENSE_BUFFERSIZE); 820 813 } 821 814 if (!sense_deferred) 822 - error = __scsi_error_from_host_byte(cmd, result); 815 + error = scsi_result_to_blk_status(cmd, result); 823 816 } 824 817 /* 825 - * __scsi_error_from_host_byte may have reset the host_byte 818 + * scsi_result_to_blk_status may have reset the host_byte 826 819 */ 827 820 scsi_req(req)->result = cmd->result; 828 821 scsi_req(req)->resid_len = scsi_get_resid(cmd); ··· 844 837 * good_bytes != blk_rq_bytes(req) as the signal for an error. 845 838 * This sets the error explicitly for the problem case. 846 839 */ 847 - error = __scsi_error_from_host_byte(cmd, result); 840 + error = scsi_result_to_blk_status(cmd, result); 848 841 } 849 842 850 843 /* no bidi support for !blk_rq_is_passthrough yet */ ··· 914 907 if (result == 0) 915 908 goto requeue; 916 909 917 - error = __scsi_error_from_host_byte(cmd, result); 910 + error = scsi_result_to_blk_status(cmd, result); 918 911 919 912 if (host_byte(result) == DID_RESET) { 920 913 /* Third party bus reset or reset for error recovery