Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | From: Benjamin Marzinski <bmarzins@redhat.com> |
| 3 | Date: Fri, 8 Jun 2018 17:12:37 -0500 |
| 4 | Subject: [PATCH] libmultipath: fix detect alua corner case |
| 5 | |
| 6 | If retain_attach_hw_handler = no, then the paths tpgs state will never |
| 7 | be checked, and the multipath device will always select the alua |
| 8 | handler, if no other handler is selected. the paths tpgs state |
| 9 | should be checked, regardless of the retain_hwhandler value. |
| 10 | |
| 11 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> |
| 12 | --- |
| 13 | libmultipath/propsel.c | 4 +++- |
| 14 | 1 file changed, 3 insertions(+), 1 deletion(-) |
| 15 | |
| 16 | diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c |
| 17 | index 62a6893..f626c74 100644 |
| 18 | --- a/libmultipath/propsel.c |
| 19 | +++ b/libmultipath/propsel.c |
| 20 | @@ -403,9 +403,11 @@ int select_hwhandler(struct config *conf, struct multipath *mp) |
| 21 | bool all_tpgs = true; |
| 22 | |
| 23 | dh_state = &handler[2]; |
| 24 | + |
| 25 | + vector_foreach_slot(mp->paths, pp, i) |
| 26 | + all_tpgs = all_tpgs && (pp->tpgs > 0); |
| 27 | if (mp->retain_hwhandler != RETAIN_HWHANDLER_OFF) { |
| 28 | vector_foreach_slot(mp->paths, pp, i) { |
| 29 | - all_tpgs = all_tpgs && (pp->tpgs > 0); |
| 30 | if (get_dh_state(pp, dh_state, sizeof(handler) - 2) > 0 |
| 31 | && strcmp(dh_state, "detached")) { |
| 32 | memcpy(handler, "1 ", 2); |
| 33 | -- |
| 34 | 2.7.4 |
| 35 | |