diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2013-08-26 07:29:46 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2013-08-26 07:29:46 +0000 |
commit | 75f7b0568c60fc6c73c92ea2979f586cbcbc1bec (patch) | |
tree | 83c79ddbf455635fab0da97ab29872fceb72ee7c /sys/scsi/mpath_emc.c | |
parent | 01dec682de0d0eb91db9e358055837917d9f874c (diff) |
introduce the idea of groups of paths. mpath had stuff to managed
devices and paths. devices are what mpath presents as targets on
its scsibus, and paths are the things attached to hardware controllers
that are available to shove io down to the actual real target. all
paths were considered usable for handling io on behalf of a device.
this adds groups in between devices and paths. only paths on the
first group in the list will now be used to handle io now.
sym devices will only have one group. asym devices will treat each
path as a different group. rdac, emc, and hds will group paths based
on which controller in the array theyre connected to.
in the future we will intercept sense data from passive controllers
and use that to start running checks to pick a new primary group
so we can handle controller failover situations.
the group id in hds(4) is currently busted, everything else should
be correct.
Diffstat (limited to 'sys/scsi/mpath_emc.c')
-rw-r--r-- | sys/scsi/mpath_emc.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/scsi/mpath_emc.c b/sys/scsi/mpath_emc.c index aa55f875a67..1d61690f29f 100644 --- a/sys/scsi/mpath_emc.c +++ b/sys/scsi/mpath_emc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpath_emc.c,v 1.8 2011/07/11 01:02:48 dlg Exp $ */ +/* $OpenBSD: mpath_emc.c,v 1.9 2013/08/26 07:29:45 dlg Exp $ */ /* * Copyright (c) 2011 David Gwynne <dlg@openbsd.org> @@ -171,10 +171,13 @@ emc_attach(struct device *parent, struct device *self, void *aux) printf("%s: %s %s SP-%c port %d\n", DEVNAME(sc), model, serial, sc->sc_sp + 'A', sc->sc_port); - if (sc->sc_lun_state == EMC_SP_INFO_LUN_STATE_OWNED) { - if (mpath_path_attach(&sc->sc_path, &emc_mpath_ops) != 0) - printf("%s: unable to attach path\n", DEVNAME(sc)); + if (sc->sc_lun_state != EMC_SP_INFO_LUN_STATE_OWNED) { + /* XXX add failover support */ + return; } + + if (mpath_path_attach(&sc->sc_path, sc->sc_sp, &emc_mpath_ops) != 0) + printf("%s: unable to attach path\n", DEVNAME(sc)); } int |