mpi3mr: Only set callout_owned when we create a timeout

Since we assume there's a timeout to cancel when this is true, only set
it true when we set the timeout. Otherwise we may try to cancel a timeout
when there's been an error in submission.

Sponsored by:		Netflix
Reviewed by:		mav
Differential Revision:	https://reviews.freebsd.org/D42541

(cherry picked from commit 1cfd01111eb6a28ca5043e928aa8e9099064177a)
This commit is contained in:
Warner Losh 2023-11-28 18:49:24 -07:00 committed by Alexander Motin
parent 3c12997a1c
commit c351a6ec91

View file

@ -1223,15 +1223,15 @@ mpi3mr_action_scsiio(struct mpi3mr_cam_softc *cam_sc, union ccb *ccb)
mpi3mr_set_ccbstatus(ccb, CAM_RESRC_UNAVAIL);
xpt_done(ccb);
} else {
callout_reset_sbt(&cm->callout, SBT_1S * 90 , 0,
mpi3mr_scsiio_timeout, cm, 0);
callout_reset_sbt(&cm->callout, mstosbt(ccb->ccb_h.timeout), 0,
mpi3mr_scsiio_timeout, cm, 0);
cm->callout_owner = true;
mpi3mr_atomic_inc(&sc->fw_outstanding);
mpi3mr_atomic_inc(&targ->outstanding);
if (mpi3mr_atomic_read(&sc->fw_outstanding) > sc->io_cmds_highwater)
sc->io_cmds_highwater++;
}
cm->callout_owner = true;
return;
}