Skip to content

Commit 83fd69c

Browse files
committed
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
2 parents 69c5eea + ea697a8 commit 83fd69c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
864864
goto qc24_fail_command;
865865
}
866866

867-
if (atomic_read(&fcport->state) != FCS_ONLINE) {
867+
if (atomic_read(&fcport->state) != FCS_ONLINE || fcport->deleted) {
868868
if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
869869
atomic_read(&base_vha->loop_state) == LOOP_DEAD) {
870870
ql_dbg(ql_dbg_io, vha, 0x3005,
@@ -946,7 +946,7 @@ qla2xxx_mqueuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd,
946946
goto qc24_fail_command;
947947
}
948948

949-
if (atomic_read(&fcport->state) != FCS_ONLINE) {
949+
if (atomic_read(&fcport->state) != FCS_ONLINE || fcport->deleted) {
950950
if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
951951
atomic_read(&base_vha->loop_state) == LOOP_DEAD) {
952952
ql_dbg(ql_dbg_io, vha, 0x3077,

drivers/scsi/sd.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3169,9 +3169,11 @@ static int sd_revalidate_disk(struct gendisk *disk)
31693169
if (sd_validate_opt_xfer_size(sdkp, dev_max)) {
31703170
q->limits.io_opt = logical_to_bytes(sdp, sdkp->opt_xfer_blocks);
31713171
rw_max = logical_to_sectors(sdp, sdkp->opt_xfer_blocks);
3172-
} else
3172+
} else {
3173+
q->limits.io_opt = 0;
31733174
rw_max = min_not_zero(logical_to_sectors(sdp, dev_max),
31743175
(sector_t)BLK_DEF_MAX_SECTORS);
3176+
}
31753177

31763178
/* Do not exceed controller limit */
31773179
rw_max = min(rw_max, queue_max_hw_sectors(q));

0 commit comments

Comments
 (0)