Commit 0befb879 authored by John Garry's avatar John Garry Committed by Martin K. Petersen
Browse files

scsi: scsi_debug: Drop check for num_in_q exceeding queue depth



The per-device num_in_q value cannot exceed the device queue depth, so drop
the check.

Signed-off-by: default avatarJohn Garry <john.g.garry@oracle.com>
Acked-by: default avatarDouglas Gilbert <dgilbert@interlog.com>
Link: https://lore.kernel.org/r/20230313093114.1498305-9-john.g.garry@oracle.com


Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 9c230382
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -5593,14 +5593,7 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip,
	}
	num_in_q = atomic_read(&devip->num_in_q);
	qdepth = cmnd->device->queue_depth;
	if (unlikely((qdepth > 0) && (num_in_q >= qdepth))) {
		if (scsi_result) {
			spin_unlock_irqrestore(&sqp->qc_lock, iflags);
			goto respond_in_thread;
		} else
			scsi_result = device_qfull_result;
	} else if (unlikely(sdebug_every_nth &&
			    (SDEBUG_OPT_RARE_TSF & sdebug_opts) &&
	if (unlikely(sdebug_every_nth && (SDEBUG_OPT_RARE_TSF & sdebug_opts) &&
		     (scsi_result == 0))) {
		if ((num_in_q == (qdepth - 1)) &&
		    (atomic_inc_return(&sdebug_a_tsf) >=