diff options
author | 2006-07-15 00:04:11 +0000 | |
---|---|---|
committer | 2006-07-15 00:04:11 +0000 | |
commit | 9a0362acc39d0e6c5938c6abd9ea53ed135eb32e (patch) | |
tree | 3ff3820911bb427a5507ccdbc4cdc3a6e423c034 /sys | |
parent | ZyXEL Prestige (diff) | |
download | wireguard-openbsd-9a0362acc39d0e6c5938c6abd9ea53ed135eb32e.tar.xz wireguard-openbsd-9a0362acc39d0e6c5938c6abd9ea53ed135eb32e.zip |
catch "Media Removal Prevented" for devices that are capable of telling us
when we're not allowed to yank things out of them. Instead of returning a
generic EIO and having the kernel printf a scsi sense to the console,
we now return EBUSY to userland and avoid the dmesg spewing.
ok krw@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/scsi/scsi_base.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c index 5d79b67a37a..7a3adc013da 100644 --- a/sys/scsi/scsi_base.c +++ b/sys/scsi/scsi_base.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_base.c,v 1.107 2006/07/13 11:46:16 krw Exp $ */ +/* $OpenBSD: scsi_base.c,v 1.108 2006/07/15 00:04:11 beck Exp $ */ /* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */ /* @@ -1006,6 +1006,9 @@ scsi_interpret_sense(struct scsi_xfer *xs) case SKEY_ILLEGAL_REQUEST: if ((xs->flags & SCSI_IGNORE_ILLEGAL_REQUEST) != 0) return (0); + if (sense->add_sense_code == 0x53 && + sense->add_sense_code_qual == 0x02) + return(EBUSY); /* Medium Removal Prevented */ error = EINVAL; break; case SKEY_UNIT_ATTENTION: |