summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2005-04-14 04:51:18 +0000
committermjacob <mjacob@FreeBSD.org>2005-04-14 04:51:18 +0000
commit986da5a2b493f6101324c7ae3f5c6660d946d4eb (patch)
tree18f5ac08d3e3220d8a2bd7d08db814ce10073cb3 /sys
parent884a26e90b7ba5844abe8c32b3efedf383702ae1 (diff)
downloadFreeBSD-src-986da5a2b493f6101324c7ae3f5c6660d946d4eb.zip
FreeBSD-src-986da5a2b493f6101324c7ae3f5c6660d946d4eb.tar.gz
Make sure we look at the correct sub op codes when
deciding whether it's an operation we can perform via the control device. PR: kern/72010 MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r--sys/cam/scsi/scsi_sa.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c
index fd9c251..88ad7a2 100644
--- a/sys/cam/scsi/scsi_sa.c
+++ b/sys/cam/scsi/scsi_sa.c
@@ -810,10 +810,29 @@ saioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
}
break;
+ case MTIOCTOP:
+ {
+ struct mtop *mt = (struct mtop *) arg;
+
+ /*
+ * Check to make sure it's an OP we can perform
+ * with no media inserted.
+ */
+ switch (mt->mt_op) {
+ case MTSETBSIZ:
+ case MTSETDNSTY:
+ case MTCOMP:
+ mt = NULL;
+ /* FALLTHROUGH */
+ default:
+ break;
+ }
+ if (mt != NULL) {
+ break;
+ }
+ /* FALLTHROUGH */
+ }
case MTIOCSETEOTMODEL:
- case MTSETBSIZ:
- case MTSETDNSTY:
- case MTCOMP:
/*
* We need to acquire the peripheral here rather
* than at open time because we are sharing writable
OpenPOWER on IntegriCloud