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

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

Pull SCSI fixes from James Bottomley:
"Eight mostly minor fixes for recently discovered issues in drivers"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: ILLEGAL REQUEST + ASC==27 => target failure
scsi: aacraid: Add a small delay after IOP reset
scsi: scsi_transport_fc: Also check for NOTPRESENT in fc_remote_port_add()
scsi: scsi_transport_fc: set scsi_target_id upon rescan
scsi: scsi_transport_iscsi: fix the issue that iscsi_if_rx doesn't parse nlmsg properly
scsi: aacraid: error: testing array offset 'bus' after use
scsi: lpfc: Don't return internal MBXERR_ERROR code from probe function
scsi: aacraid: Fix 2T+ drives on SmartIOC-2000

+32 -27
+6 -6
drivers/scsi/aacraid/aachba.c
··· 699 699 int status; 700 700 701 701 dresp = (struct aac_mount *) fib_data(fibptr); 702 - if (!(fibptr->dev->supplement_adapter_info.supported_options2 & 703 - AAC_OPTION_VARIABLE_BLOCK_SIZE)) 702 + if (!aac_supports_2T(fibptr->dev)) { 704 703 dresp->mnt[0].capacityhigh = 0; 705 - if ((le32_to_cpu(dresp->status) != ST_OK) || 706 - (le32_to_cpu(dresp->mnt[0].vol) != CT_NONE)) { 707 - _aac_probe_container2(context, fibptr); 708 - return; 704 + if ((le32_to_cpu(dresp->status) == ST_OK) && 705 + (le32_to_cpu(dresp->mnt[0].vol) != CT_NONE)) { 706 + _aac_probe_container2(context, fibptr); 707 + return; 708 + } 709 709 } 710 710 scsicmd = (struct scsi_cmnd *) context; 711 711
+5
drivers/scsi/aacraid/aacraid.h
··· 2701 2701 return 0; 2702 2702 } 2703 2703 2704 + static inline int aac_supports_2T(struct aac_dev *dev) 2705 + { 2706 + return (dev->adapter_info.options & AAC_OPT_NEW_COMM_64); 2707 + } 2708 + 2704 2709 char * get_container_type(unsigned type); 2705 2710 extern int numacb; 2706 2711 extern char aac_driver_version[];
+12 -8
drivers/scsi/aacraid/linit.c
··· 906 906 907 907 bus = aac_logical_to_phys(scmd_channel(cmd)); 908 908 cid = scmd_id(cmd); 909 - info = &aac->hba_map[bus][cid]; 910 - if (bus >= AAC_MAX_BUSES || cid >= AAC_MAX_TARGETS || 911 - info->devtype != AAC_DEVTYPE_NATIVE_RAW) 909 + 910 + if (bus >= AAC_MAX_BUSES || cid >= AAC_MAX_TARGETS) 912 911 return FAILED; 913 912 914 - if (info->reset_state > 0) 913 + info = &aac->hba_map[bus][cid]; 914 + 915 + if (info->devtype != AAC_DEVTYPE_NATIVE_RAW && 916 + info->reset_state > 0) 915 917 return FAILED; 916 918 917 919 pr_err("%s: Host adapter reset request. SCSI hang ?\n", ··· 964 962 965 963 bus = aac_logical_to_phys(scmd_channel(cmd)); 966 964 cid = scmd_id(cmd); 967 - info = &aac->hba_map[bus][cid]; 968 - if (bus >= AAC_MAX_BUSES || cid >= AAC_MAX_TARGETS || 969 - info->devtype != AAC_DEVTYPE_NATIVE_RAW) 965 + 966 + if (bus >= AAC_MAX_BUSES || cid >= AAC_MAX_TARGETS) 970 967 return FAILED; 971 968 972 - if (info->reset_state > 0) 969 + info = &aac->hba_map[bus][cid]; 970 + 971 + if (info->devtype != AAC_DEVTYPE_NATIVE_RAW && 972 + info->reset_state > 0) 973 973 return FAILED; 974 974 975 975 pr_err("%s: Host adapter reset request. SCSI hang ?\n",
+2
drivers/scsi/aacraid/src.c
··· 740 740 aac_set_intx_mode(dev); 741 741 742 742 src_writel(dev, MUnit.IDR, IOP_SRC_RESET_MASK); 743 + 744 + msleep(5000); 743 745 } 744 746 745 747 static void aac_send_hardware_soft_reset(struct aac_dev *dev)
+1
drivers/scsi/lpfc/lpfc_init.c
··· 6131 6131 "Extents and RPI headers enabled.\n"); 6132 6132 } 6133 6133 mempool_free(mboxq, phba->mbox_mem_pool); 6134 + rc = -EIO; 6134 6135 goto out_free_bsmbx; 6135 6136 } 6136 6137
+2 -1
drivers/scsi/scsi_error.c
··· 580 580 if (sshdr.asc == 0x20 || /* Invalid command operation code */ 581 581 sshdr.asc == 0x21 || /* Logical block address out of range */ 582 582 sshdr.asc == 0x24 || /* Invalid field in cdb */ 583 - sshdr.asc == 0x26) { /* Parameter value invalid */ 583 + sshdr.asc == 0x26 || /* Parameter value invalid */ 584 + sshdr.asc == 0x27) { /* Write protected */ 584 585 set_host_byte(scmd, DID_TARGET_FAILURE); 585 586 } 586 587 return SUCCESS;
+3 -11
drivers/scsi/scsi_transport_fc.c
··· 2739 2739 2740 2740 list_for_each_entry(rport, &fc_host->rports, peers) { 2741 2741 2742 - if ((rport->port_state == FC_PORTSTATE_BLOCKED) && 2742 + if ((rport->port_state == FC_PORTSTATE_BLOCKED || 2743 + rport->port_state == FC_PORTSTATE_NOTPRESENT) && 2743 2744 (rport->channel == channel)) { 2744 2745 2745 2746 switch (fc_host->tgtid_bind_type) { ··· 2877 2876 memcpy(&rport->port_name, &ids->port_name, 2878 2877 sizeof(rport->port_name)); 2879 2878 rport->port_id = ids->port_id; 2880 - rport->roles = ids->roles; 2881 2879 rport->port_state = FC_PORTSTATE_ONLINE; 2882 2880 rport->flags &= ~FC_RPORT_FAST_FAIL_TIMEDOUT; 2883 2881 ··· 2885 2885 fci->f->dd_fcrport_size); 2886 2886 spin_unlock_irqrestore(shost->host_lock, flags); 2887 2887 2888 - if (ids->roles & FC_PORT_ROLE_FCP_TARGET) { 2889 - scsi_target_unblock(&rport->dev, SDEV_RUNNING); 2890 - 2891 - /* initiate a scan of the target */ 2892 - spin_lock_irqsave(shost->host_lock, flags); 2893 - rport->flags |= FC_RPORT_SCAN_PENDING; 2894 - scsi_queue_work(shost, &rport->scan_work); 2895 - spin_unlock_irqrestore(shost->host_lock, flags); 2896 - } 2888 + fc_remote_port_rolechg(rport, ids->roles); 2897 2889 return rport; 2898 2890 } 2899 2891 }
+1 -1
drivers/scsi/scsi_transport_iscsi.c
··· 3689 3689 uint32_t group; 3690 3690 3691 3691 nlh = nlmsg_hdr(skb); 3692 - if (nlh->nlmsg_len < sizeof(*nlh) || 3692 + if (nlh->nlmsg_len < sizeof(*nlh) + sizeof(*ev) || 3693 3693 skb->len < nlh->nlmsg_len) { 3694 3694 break; 3695 3695 }