diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2010-01-13 05:08:56 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2010-01-13 05:08:56 +0000 |
commit | c73b1f6661c81b4a6eb8c7972223cd1454e49499 (patch) | |
tree | b9ba2f0ee0ae225ebd0b27a35b0de627cc0a29bd /sys/scsi | |
parent | d25f7fe59eb7a269ff1c3f442eeec82af0eab863 (diff) |
when checking an xs for errors, first check if the device the xs is for
is dying. if so, return ENXIO.
this should make detach of devices during scsi attaches less dangerous.
idea (and the first version of this diff) ok deraadt@
ok krw@
Diffstat (limited to 'sys/scsi')
-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 3714db90057..de0eb8e9b4b 100644 --- a/sys/scsi/scsi_base.c +++ b/sys/scsi/scsi_base.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_base.c,v 1.159 2010/01/13 03:09:05 dlg Exp $ */ +/* $OpenBSD: scsi_base.c,v 1.160 2010/01/13 05:08:55 dlg Exp $ */ /* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */ /* @@ -900,6 +900,9 @@ scsi_xs_error(struct scsi_xfer *xs) SC_DEBUG(xs->sc_link, SDEV_DB3, ("scsi_xs_error,err = 0x%x\n", xs->error)); + if (ISSET(xs->sc_link->state, SDEV_S_DYING)) + return (ENXIO); + switch (xs->error) { case XS_NOERROR: /* nearly always hit this one */ error = 0; |