diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/scsi/sd.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index 0d7a6a2317d..733d56b426a 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.123 2007/04/11 10:54:57 bluhm Exp $ */ +/* $OpenBSD: sd.c,v 1.124 2007/04/13 18:56:26 krw Exp $ */ /* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */ /*- @@ -378,14 +378,16 @@ sdopen(dev_t dev, int flag, int fmt, struct proc *p) goto bad; } - /* Lock the pack in. */ - if ((sc_link->flags & SDEV_REMOVABLE) != 0) { - error = scsi_prevent(sc_link, PR_PREVENT, + /* + * Try to prevent the unloading of a removable device while + * it's open. But allow the open to proceed if the device can't + * be locked in. + */ + if ((sc_link->flags & SDEV_REMOVABLE) != 0) + scsi_prevent(sc_link, PR_PREVENT, SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_IGNORE_MEDIA_CHANGE); - if (error) - goto bad; - } + /* Load the physical device parameters. */ sc_link->flags |= SDEV_MEDIA_LOADED; if (sd_get_parms(sd, &sd->params, (rawopen ? SCSI_SILENT : 0)) |