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

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