summaryrefslogtreecommitdiffstats
path: root/0039-RH-detect-prio-fix.patch
blob: 941a57087a234dc3b7020dac2f771f615957f9d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
---
 libmultipath/propsel.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Index: multipath-tools-130222/libmultipath/propsel.c
===================================================================
--- multipath-tools-130222.orig/libmultipath/propsel.c
+++ multipath-tools-130222/libmultipath/propsel.c
@@ -384,10 +384,17 @@ select_getuid (struct path * pp)
 void
 detect_prio(struct path * pp)
 {
+	int ret;
 	struct prio *p = &pp->prio;
 
-	if (get_target_port_group_support(pp->fd) > 0)
-		prio_get(p, PRIO_ALUA, DEFAULT_PRIO_ARGS);
+	if (get_target_port_group_support(pp->fd) <= 0)
+		return;
+	ret = get_target_port_group(pp->fd);
+	if (ret < 0)
+		return;
+	if (get_asymmetric_access_state(pp->fd, ret) < 0)
+		return;
+	prio_get(p, PRIO_ALUA, DEFAULT_PRIO_ARGS);
 }
 
 extern int