Blame SOURCES/0254-RHBZ-1635819-fix-mpathpersist-crash.patch

4728c8
---
4728c8
 libmpathpersist/mpath_persist.c |   11 +++++------
4728c8
 1 file changed, 5 insertions(+), 6 deletions(-)
4728c8
4728c8
Index: multipath-tools-130222/libmpathpersist/mpath_persist.c
4728c8
===================================================================
4728c8
--- multipath-tools-130222.orig/libmpathpersist/mpath_persist.c
4728c8
+++ multipath-tools-130222/libmpathpersist/mpath_persist.c
4728c8
@@ -524,10 +524,10 @@ int mpath_prout_reg(struct multipath *mp
4728c8
 		if (!rollback && (thread[i].param.status == MPATH_PR_RESERV_CONFLICT)){
4728c8
 			rollback = 1;
4728c8
 			sa_key = 0;
4728c8
-			for (i = 0; i < 8; ++i){
4728c8
-				if (i > 0)
4728c8
+			for (j = 0; j < 8; ++j){
4728c8
+				if (j > 0)
4728c8
 					sa_key <<= 8;
4728c8
-				sa_key |= paramp->sa_key[i];
4728c8
+				sa_key |= paramp->sa_key[j];
4728c8
 			}
4728c8
 			status = MPATH_PR_RESERV_CONFLICT ;
4728c8
 		}
4728c8
@@ -537,11 +537,10 @@ int mpath_prout_reg(struct multipath *mp
4728c8
 	}
4728c8
 	if (rollback && ((rq_servact == MPATH_PROUT_REG_SA) && sa_key != 0 )){
4728c8
 		condlog (3, "%s: ERROR: initiating pr out rollback", mpp->wwid);
4728c8
+		memcpy(&paramp->key, &paramp->sa_key, 8);
4728c8
+		memset(&paramp->sa_key, 0, 8);
4728c8
 		for( i=0 ; i < count ; i++){
4728c8
 			if (thread[i].param.status == MPATH_PR_SUCCESS) {
4728c8
-				memcpy(&thread[i].param.paramp->key, &thread[i].param.paramp->sa_key, 8);
4728c8
-				memset(&thread[i].param.paramp->sa_key, 0, 8);
4728c8
-				thread[i].param.status = MPATH_PR_SUCCESS;
4728c8
 				rc = pthread_create(&thread[i].id, &attr, mpath_prout_pthread_fn, 
4728c8
 						(void *)(&thread[i].param));
4728c8
 				if (rc){