summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-06-25 07:07:32 +0000
committermav <mav@FreeBSD.org>2015-06-25 07:07:32 +0000
commit912011aeb8cd499cc268cf8f06d8aa1da2878d3c (patch)
treeba7e28b96917ecd454ebb0cb88871d87f40b47b5
parentfc8d3d0aa2fe5e86c4f93244c9f916b79e52c5a1 (diff)
downloadFreeBSD-src-912011aeb8cd499cc268cf8f06d8aa1da2878d3c.zip
FreeBSD-src-912011aeb8cd499cc268cf8f06d8aa1da2878d3c.tar.gz
MFC r284622: Remove device queue freeze handling and replace it with dummy.
At this point CTL has no known use case for device queue freezes. Same time existing (considered to be broken) code was found to cause modify-after-free issues.
-rw-r--r--sys/cam/ctl/scsi_ctl.c44
1 files changed, 14 insertions, 30 deletions
diff --git a/sys/cam/ctl/scsi_ctl.c b/sys/cam/ctl/scsi_ctl.c
index 693fd07..a315789 100644
--- a/sys/cam/ctl/scsi_ctl.c
+++ b/sys/cam/ctl/scsi_ctl.c
@@ -848,15 +848,6 @@ ctlfestart(struct cam_periph *periph, union ccb *start_ccb)
atio->ccb_h.target_lun = CAM_LUN_WILDCARD;
}
- if ((atio->ccb_h.status & CAM_DEV_QFRZN) != 0) {
- cam_release_devq(periph->path,
- /*relsim_flags*/0,
- /*reduction*/0,
- /*timeout*/0,
- /*getcount_only*/0);
- atio->ccb_h.status &= ~CAM_DEV_QFRZN;
- }
-
if (atio->ccb_h.func_code != XPT_ACCEPT_TARGET_IO) {
xpt_print(periph->path, "%s: func_code "
"is %#x\n", __func__,
@@ -966,15 +957,6 @@ ctlfestart(struct cam_periph *periph, union ccb *start_ccb)
xpt_action(start_ccb);
cam_periph_lock(periph);
- if ((atio->ccb_h.status & CAM_DEV_QFRZN) != 0) {
- cam_release_devq(periph->path,
- /*relsim_flags*/0,
- /*reduction*/0,
- /*timeout*/0,
- /*getcount_only*/0);
- atio->ccb_h.status &= ~CAM_DEV_QFRZN;
- }
-
/*
* If we still have work to do, ask for another CCB.
*/
@@ -1107,6 +1089,19 @@ ctlfedone(struct cam_periph *periph, union ccb *done_ccb)
done_ccb->ccb_h.func_code);
#endif
+ /*
+ * At this point CTL has no known use case for device queue freezes.
+ * In case some SIM think different -- drop its freeze right here.
+ */
+ if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
+ cam_release_devq(periph->path,
+ /*relsim_flags*/0,
+ /*reduction*/0,
+ /*timeout*/0,
+ /*getcount_only*/0);
+ done_ccb->ccb_h.status &= ~CAM_DEV_QFRZN;
+ }
+
softc = (struct ctlfe_lun_softc *)periph->softc;
bus_softc = softc->parent_softc;
mtx = cam_periph_mtx(periph);
@@ -1417,12 +1412,9 @@ ctlfedone(struct cam_periph *periph, union ccb *done_ccb)
union ctl_io *io;
struct ccb_immediate_notify *inot;
cam_status status;
- int frozen, send_ctl_io;
+ int send_ctl_io;
inot = &done_ccb->cin1;
-
- frozen = (done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0;
-
printf("%s: got XPT_IMMEDIATE_NOTIFY status %#x tag %#x "
"seq %#x\n", __func__, inot->ccb_h.status,
inot->tag_id, inot->seq_id);
@@ -1524,14 +1516,6 @@ ctlfedone(struct cam_periph *periph, union ccb *done_ccb)
done_ccb->ccb_h.func_code = XPT_NOTIFY_ACKNOWLEDGE;
xpt_action(done_ccb);
}
-
- if (frozen != 0) {
- cam_release_devq(periph->path,
- /*relsim_flags*/ 0,
- /*opening reduction*/ 0,
- /*timeout*/ 0,
- /*getcount_only*/ 0);
- }
break;
}
case XPT_NOTIFY_ACKNOWLEDGE:
OpenPOWER on IntegriCloud