SCSI fixes on 20191111
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. Signed-off-by: James E.J. Bottomley <jejb@linux.ibm.com> -----BEGIN PGP SIGNATURE----- iJwEABMIAEQWIQTnYEDbdso9F2cI+arnQslM7pishQUCXcmURyYcamFtZXMuYm90 dG9tbGV5QGhhbnNlbnBhcnRuZXJzaGlwLmNvbQAKCRDnQslM7pishV63APoCnP9P kJP1Bp1fd7f91FrFaxY7sKH9VZqbioUtwUhE9AD/f0o5/gg/5jSIM90GKXdZYVpt KIsIaQzVOPL3K7EaFDs= =77IM -----END PGP SIGNATURE----- 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()
This commit is contained in:
commit
72d5ac679e
|
@ -76,9 +76,11 @@ qla24xx_deallocate_vp_id(scsi_qla_host_t *vha)
|
||||||
* ensures no active vp_list traversal while the vport is removed
|
* ensures no active vp_list traversal while the vport is removed
|
||||||
* from the queue)
|
* from the queue)
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < 10 && atomic_read(&vha->vref_count); i++)
|
for (i = 0; i < 10; i++) {
|
||||||
wait_event_timeout(vha->vref_waitq,
|
if (wait_event_timeout(vha->vref_waitq,
|
||||||
atomic_read(&vha->vref_count), HZ);
|
!atomic_read(&vha->vref_count), HZ) > 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
spin_lock_irqsave(&ha->vport_slock, flags);
|
spin_lock_irqsave(&ha->vport_slock, flags);
|
||||||
if (atomic_read(&vha->vref_count)) {
|
if (atomic_read(&vha->vref_count)) {
|
||||||
|
|
|
@ -1119,9 +1119,11 @@ qla2x00_wait_for_sess_deletion(scsi_qla_host_t *vha)
|
||||||
|
|
||||||
qla2x00_mark_all_devices_lost(vha, 0);
|
qla2x00_mark_all_devices_lost(vha, 0);
|
||||||
|
|
||||||
for (i = 0; i < 10; i++)
|
for (i = 0; i < 10; i++) {
|
||||||
wait_event_timeout(vha->fcport_waitQ, test_fcport_count(vha),
|
if (wait_event_timeout(vha->fcport_waitQ,
|
||||||
HZ);
|
test_fcport_count(vha), HZ) > 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
flush_workqueue(vha->hw->wq);
|
flush_workqueue(vha->hw->wq);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1883,7 +1883,8 @@ int scsi_mq_setup_tags(struct Scsi_Host *shost)
|
||||||
{
|
{
|
||||||
unsigned int cmd_size, sgl_size;
|
unsigned int cmd_size, sgl_size;
|
||||||
|
|
||||||
sgl_size = scsi_mq_inline_sgl_size(shost);
|
sgl_size = max_t(unsigned int, sizeof(struct scatterlist),
|
||||||
|
scsi_mq_inline_sgl_size(shost));
|
||||||
cmd_size = sizeof(struct scsi_cmnd) + shost->hostt->cmd_size + sgl_size;
|
cmd_size = sizeof(struct scsi_cmnd) + shost->hostt->cmd_size + sgl_size;
|
||||||
if (scsi_host_get_prot(shost))
|
if (scsi_host_get_prot(shost))
|
||||||
cmd_size += sizeof(struct scsi_data_buffer) +
|
cmd_size += sizeof(struct scsi_data_buffer) +
|
||||||
|
|
|
@ -263,25 +263,16 @@ void sd_zbc_complete(struct scsi_cmnd *cmd, unsigned int good_bytes,
|
||||||
int result = cmd->result;
|
int result = cmd->result;
|
||||||
struct request *rq = cmd->request;
|
struct request *rq = cmd->request;
|
||||||
|
|
||||||
switch (req_op(rq)) {
|
if (req_op(rq) == REQ_OP_ZONE_RESET &&
|
||||||
case REQ_OP_ZONE_RESET:
|
result &&
|
||||||
case REQ_OP_ZONE_RESET_ALL:
|
sshdr->sense_key == ILLEGAL_REQUEST &&
|
||||||
|
sshdr->asc == 0x24) {
|
||||||
if (result &&
|
/*
|
||||||
sshdr->sense_key == ILLEGAL_REQUEST &&
|
* INVALID FIELD IN CDB error: reset of a conventional
|
||||||
sshdr->asc == 0x24)
|
* zone was attempted. Nothing to worry about, so be
|
||||||
/*
|
* quiet about the error.
|
||||||
* INVALID FIELD IN CDB error: reset of a conventional
|
*/
|
||||||
* zone was attempted. Nothing to worry about, so be
|
rq->rq_flags |= RQF_QUIET;
|
||||||
* quiet about the error.
|
|
||||||
*/
|
|
||||||
rq->rq_flags |= RQF_QUIET;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case REQ_OP_WRITE:
|
|
||||||
case REQ_OP_WRITE_ZEROES:
|
|
||||||
case REQ_OP_WRITE_SAME:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue