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:
"Two small fixes: one in drivers (qla2xxx), and one in the core (sd) to
try to cope with USB enclosures that silently change reported
parameters"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: sd: Fix optimal I/O size for devices that change reported values
scsi: qla2xxx: Fix I/Os being passed down when FC device is being deleted

+5 -3
+2 -2
drivers/scsi/qla2xxx/qla_os.c
··· 864 864 goto qc24_fail_command; 865 865 } 866 866 867 - if (atomic_read(&fcport->state) != FCS_ONLINE) { 867 + if (atomic_read(&fcport->state) != FCS_ONLINE || fcport->deleted) { 868 868 if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD || 869 869 atomic_read(&base_vha->loop_state) == LOOP_DEAD) { 870 870 ql_dbg(ql_dbg_io, vha, 0x3005, ··· 946 946 goto qc24_fail_command; 947 947 } 948 948 949 - if (atomic_read(&fcport->state) != FCS_ONLINE) { 949 + if (atomic_read(&fcport->state) != FCS_ONLINE || fcport->deleted) { 950 950 if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD || 951 951 atomic_read(&base_vha->loop_state) == LOOP_DEAD) { 952 952 ql_dbg(ql_dbg_io, vha, 0x3077,
+3 -1
drivers/scsi/sd.c
··· 3169 3169 if (sd_validate_opt_xfer_size(sdkp, dev_max)) { 3170 3170 q->limits.io_opt = logical_to_bytes(sdp, sdkp->opt_xfer_blocks); 3171 3171 rw_max = logical_to_sectors(sdp, sdkp->opt_xfer_blocks); 3172 - } else 3172 + } else { 3173 + q->limits.io_opt = 0; 3173 3174 rw_max = min_not_zero(logical_to_sectors(sdp, dev_max), 3174 3175 (sector_t)BLK_DEF_MAX_SECTORS); 3176 + } 3175 3177 3176 3178 /* Do not exceed controller limit */ 3177 3179 rw_max = min(rw_max, queue_max_hw_sectors(q));