diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2010-09-25 00:31:32 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2010-09-25 00:31:32 +0000 |
commit | 1122425d56244a5b0b90415b4ca9f9d999d1d649 (patch) | |
tree | f7ab1e567e6f33add95aa83da78700dc069b2728 | |
parent | 4c7171c81caad8338c310a37a58d58fe2dfb5aef (diff) |
when vscsi is closed, deactivate all child devices so when we kill the
commands still on the queues the child device wont retry it cos its been
deactivated.
-rw-r--r-- | sys/dev/vscsi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/vscsi.c b/sys/dev/vscsi.c index 907ea42b41c..c5444f55396 100644 --- a/sys/dev/vscsi.c +++ b/sys/dev/vscsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vscsi.c,v 1.20 2010/09/22 04:52:10 matthew Exp $ */ +/* $OpenBSD: vscsi.c,v 1.21 2010/09/25 00:31:31 dlg Exp $ */ /* * Copyright (c) 2008 David Gwynne <dlg@openbsd.org> @@ -550,6 +550,8 @@ vscsiclose(dev_t dev, int flags, int mode, struct proc *p) sc->sc_state = VSCSI_S_CONFIG; mtx_leave(&sc->sc_state_mtx); + scsi_activate(sc->sc_scsibus, -1, -1, DVACT_DEACTIVATE); + while ((ccb = TAILQ_FIRST(&sc->sc_ccb_t2i)) != NULL) { TAILQ_REMOVE(&sc->sc_ccb_t2i, ccb, ccb_entry); ccb->ccb_xs->error = XS_DRIVER_STUFFUP; @@ -562,7 +564,6 @@ vscsiclose(dev_t dev, int flags, int mode, struct proc *p) vscsi_done(sc, ccb); } - scsi_activate(sc->sc_scsibus, -1, -1, DVACT_DEACTIVATE); scsi_req_detach(sc->sc_scsibus, -1, -1, DETACH_FORCE); mtx_enter(&sc->sc_state_mtx); |