From 556a5c3bad2a66818230c03e1b0cd8f017e1cdec Mon Sep 17 00:00:00 2001 From: Peter Avalos Date: Thu, 29 Nov 2007 03:31:15 +0000 Subject: [PATCH] Make sure we look at the correct sub op codes when deciding whether it's an operation we can perform via the control device. Obtained-from: FreeBSD --- sys/bus/cam/scsi/scsi_sa.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/sys/bus/cam/scsi/scsi_sa.c b/sys/bus/cam/scsi/scsi_sa.c index 2d6408ed06..5a4f831a74 100644 --- a/sys/bus/cam/scsi/scsi_sa.c +++ b/sys/bus/cam/scsi/scsi_sa.c @@ -1,6 +1,6 @@ /* * $FreeBSD: src/sys/cam/scsi/scsi_sa.c,v 1.45.2.13 2002/12/17 17:08:50 trhodes Exp $ - * $DragonFly: src/sys/bus/cam/scsi/scsi_sa.c,v 1.30 2007/11/29 02:56:42 pavalos Exp $ + * $DragonFly: src/sys/bus/cam/scsi/scsi_sa.c,v 1.31 2007/11/29 03:31:15 pavalos Exp $ * * Implementation of SCSI Sequential Access Peripheral driver for CAM. * @@ -827,10 +827,29 @@ saioctl(struct dev_ioctl_args *ap) crit_exit(); break; + case MTIOCTOP: + { + struct mtop *mt = (struct mtop *) addr; + + /* + * 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 -- 2.11.4.GIT