Skip to content

Commit 72d5ac6

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: "Three small changes: two in the core and one in the qla2xxx driver. The sg_tablesize fix affects a thinko in the migration to blk-mq of certain legacy drivers which could cause an oops and the sd core change should only affect zoned block devices which were wrongly suppressing error messages for reset all zones" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: core: Handle drivers which set sg_tablesize to zero scsi: qla2xxx: fix NPIV tear down process scsi: sd_zbc: Fix sd_zbc_complete()
2 parents 31f4f5b + 9393c8d commit 72d5ac6

File tree

4 files changed

+22
-26
lines changed

4 files changed

+22
-26
lines changed

drivers/scsi/qla2xxx/qla_mid.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@ qla24xx_deallocate_vp_id(scsi_qla_host_t *vha)
7676
* ensures no active vp_list traversal while the vport is removed
7777
* from the queue)
7878
*/
79-
for (i = 0; i < 10 && atomic_read(&vha->vref_count); i++)
80-
wait_event_timeout(vha->vref_waitq,
81-
atomic_read(&vha->vref_count), HZ);
79+
for (i = 0; i < 10; i++) {
80+
if (wait_event_timeout(vha->vref_waitq,
81+
!atomic_read(&vha->vref_count), HZ) > 0)
82+
break;
83+
}
8284

8385
spin_lock_irqsave(&ha->vport_slock, flags);
8486
if (atomic_read(&vha->vref_count)) {

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,9 +1119,11 @@ qla2x00_wait_for_sess_deletion(scsi_qla_host_t *vha)
11191119

11201120
qla2x00_mark_all_devices_lost(vha, 0);
11211121

1122-
for (i = 0; i < 10; i++)
1123-
wait_event_timeout(vha->fcport_waitQ, test_fcport_count(vha),
1124-
HZ);
1122+
for (i = 0; i < 10; i++) {
1123+
if (wait_event_timeout(vha->fcport_waitQ,
1124+
test_fcport_count(vha), HZ) > 0)
1125+
break;
1126+
}
11251127

11261128
flush_workqueue(vha->hw->wq);
11271129
}

drivers/scsi/scsi_lib.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1883,7 +1883,8 @@ int scsi_mq_setup_tags(struct Scsi_Host *shost)
18831883
{
18841884
unsigned int cmd_size, sgl_size;
18851885

1886-
sgl_size = scsi_mq_inline_sgl_size(shost);
1886+
sgl_size = max_t(unsigned int, sizeof(struct scatterlist),
1887+
scsi_mq_inline_sgl_size(shost));
18871888
cmd_size = sizeof(struct scsi_cmnd) + shost->hostt->cmd_size + sgl_size;
18881889
if (scsi_host_get_prot(shost))
18891890
cmd_size += sizeof(struct scsi_data_buffer) +

drivers/scsi/sd_zbc.c

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -263,25 +263,16 @@ void sd_zbc_complete(struct scsi_cmnd *cmd, unsigned int good_bytes,
263263
int result = cmd->result;
264264
struct request *rq = cmd->request;
265265

266-
switch (req_op(rq)) {
267-
case REQ_OP_ZONE_RESET:
268-
case REQ_OP_ZONE_RESET_ALL:
269-
270-
if (result &&
271-
sshdr->sense_key == ILLEGAL_REQUEST &&
272-
sshdr->asc == 0x24)
273-
/*
274-
* INVALID FIELD IN CDB error: reset of a conventional
275-
* zone was attempted. Nothing to worry about, so be
276-
* quiet about the error.
277-
*/
278-
rq->rq_flags |= RQF_QUIET;
279-
break;
280-
281-
case REQ_OP_WRITE:
282-
case REQ_OP_WRITE_ZEROES:
283-
case REQ_OP_WRITE_SAME:
284-
break;
266+
if (req_op(rq) == REQ_OP_ZONE_RESET &&
267+
result &&
268+
sshdr->sense_key == ILLEGAL_REQUEST &&
269+
sshdr->asc == 0x24) {
270+
/*
271+
* INVALID FIELD IN CDB error: reset of a conventional
272+
* zone was attempted. Nothing to worry about, so be
273+
* quiet about the error.
274+
*/
275+
rq->rq_flags |= RQF_QUIET;
285276
}
286277
}
287278

0 commit comments

Comments
 (0)