diff options
-rw-r--r-- | sys/cam/scsi/scsi_sa.c | 25 |
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 |