summaryrefslogtreecommitdiff
path: root/sys/scsi
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2014-04-20 00:50:19 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2014-04-20 00:50:19 +0000
commit709675285c534f32efcca5aa40c0da5bd1cc1dcc (patch)
tree04228991abc5eda0e902ef6aada0a25f286f835f /sys/scsi
parent3dcf83df62a06ec4e1a7784171205fa14f5f0718 (diff)
make the status handler more like rdac and emc. the big functional change
is to check xs->status on completion to make sure it worked.
Diffstat (limited to 'sys/scsi')
-rw-r--r--sys/scsi/mpath_hds.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/sys/scsi/mpath_hds.c b/sys/scsi/mpath_hds.c
index b2a593ba409..0a57c37eca7 100644
--- a/sys/scsi/mpath_hds.c
+++ b/sys/scsi/mpath_hds.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpath_hds.c,v 1.15 2014/04/03 04:02:50 dlg Exp $ */
+/* $OpenBSD: mpath_hds.c,v 1.16 2014/04/20 00:50:18 dlg Exp $ */
/*
* Copyright (c) 2011 David Gwynne <dlg@openbsd.org>
@@ -245,17 +245,16 @@ hds_status_done(struct scsi_xfer *xs)
struct scsi_link *link = xs->sc_link;
struct hds_softc *sc = link->device_softc;
struct hds_vpd *vpd = sc->sc_vpd;
- int status;
+ int status = MPATH_S_UNKNOWN;
- scsi_xs_put(xs);
+ if (xs->error == XS_NOERROR &&
+ _2btol(vpd->hdr.page_length) >= sizeof(vpd->state) &&
+ ISSET(vpd->state, HDS_VPD_VALID)) {
+ status = ISSET(vpd->state, HDS_VPD_PREFERRED) ?
+ MPATH_S_ACTIVE : MPATH_S_PASSIVE;
+ }
- if (_2btol(vpd->hdr.page_length) < sizeof(vpd->state) ||
- !ISSET(vpd->state, HDS_VPD_VALID))
- status = MPATH_S_UNKNOWN;
- else if (ISSET(vpd->state, HDS_VPD_PREFERRED))
- status = MPATH_S_ACTIVE;
- else
- status = MPATH_S_PASSIVE;
+ scsi_xs_put(xs);
mpath_path_status(&sc->sc_path, status);
}