Only lock the pack in if the disk device is a removable one. This fixes a

problem with Hitachi SCA drives
This commit is contained in:
explorer 2001-03-09 16:07:39 +00:00
parent 75a60f539a
commit b12c43f70a
1 changed files with 15 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: sd.c,v 1.169 2001/01/08 02:03:48 fvdl Exp $ */
/* $NetBSD: sd.c,v 1.170 2001/03/09 16:07:39 explorer Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -409,11 +409,14 @@ sdopen(dev, flag, fmt, p)
sc_link->flags |= SDEV_OPEN;
/* Lock the pack in. */
error = scsipi_prevent(sc_link, PR_PREVENT,
XS_CTL_IGNORE_ILLEGAL_REQUEST | XS_CTL_IGNORE_MEDIA_CHANGE);
if (error)
goto bad;
if (sd->sc_link->flags & SDEV_REMOVABLE) {
/* Lock the pack in. */
error = scsipi_prevent(sc_link, PR_PREVENT,
XS_CTL_IGNORE_ILLEGAL_REQUEST
| XS_CTL_IGNORE_MEDIA_CHANGE);
if (error)
goto bad;
}
if ((sc_link->flags & SDEV_MEDIA_LOADED) == 0) {
sc_link->flags |= SDEV_MEDIA_LOADED;
@ -526,8 +529,12 @@ sdclose(dev, flag, fmt, p)
scsipi_wait_drain(sd->sc_link);
scsipi_prevent(sd->sc_link, PR_ALLOW,
XS_CTL_IGNORE_ILLEGAL_REQUEST | XS_CTL_IGNORE_NOT_READY);
if (sd->sc_link->flags & SDEV_REMOVABLE) {
scsipi_prevent(sd->sc_link, PR_ALLOW,
XS_CTL_IGNORE_ILLEGAL_REQUEST
| XS_CTL_IGNORE_NOT_READY);
}
sd->sc_link->flags &= ~SDEV_OPEN;
if (! (sd->sc_link->flags & SDEV_KEEP_LABEL))