From 986da5a2b493f6101324c7ae3f5c6660d946d4eb Mon Sep 17 00:00:00 2001 From: mjacob Date: Thu, 14 Apr 2005 04:51:18 +0000 Subject: 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 --- sys/cam/scsi/scsi_sa.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'sys') 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 -- cgit v1.1