summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2014-04-20 00:50:18 +0000
committerdlg <dlg@openbsd.org>2014-04-20 00:50:18 +0000
commit2cdf3b65e5969bca7cc288528e9e0ebe86b7906e (patch)
tree0e707fab4efbffd304777ae0054a863f89e24ed2
parentemc on my cx500 works as well as rdac on all my rebadged engenio kit. (diff)
downloadwireguard-openbsd-2cdf3b65e5969bca7cc288528e9e0ebe86b7906e.tar.xz
wireguard-openbsd-2cdf3b65e5969bca7cc288528e9e0ebe86b7906e.zip
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.
-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);
}