|
|
5c2e41 |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
5c2e41 |
From: Benjamin Marzinski <bmarzins@redhat.com>
|
|
|
5c2e41 |
Date: Mon, 8 Oct 2018 16:45:11 -0500
|
|
|
5c2e41 |
Subject: [PATCH] mpathpersist: fix registration rollback issue
|
|
|
5c2e41 |
|
|
|
5c2e41 |
When mpathpersist tries to rollback the registration, it copies
|
|
|
5c2e41 |
the SARK to the RK, and clears the SARK. However, it repeated this step
|
|
|
5c2e41 |
for each thread. This means that the first rollback thread correctly
|
|
|
5c2e41 |
had the RK set to the SARK used during registration. However, if more
|
|
|
5c2e41 |
than one registration needed to be rolled back, later threads would have
|
|
|
5c2e41 |
both the RK and SARK cleared. This commit fixes that by only copying and
|
|
|
5c2e41 |
clearing the SARK once.
|
|
|
5c2e41 |
|
|
|
5c2e41 |
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|
|
5c2e41 |
---
|
|
|
5c2e41 |
libmpathpersist/mpath_persist.c | 5 ++---
|
|
|
5c2e41 |
1 file changed, 2 insertions(+), 3 deletions(-)
|
|
|
5c2e41 |
|
|
|
5c2e41 |
diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c
|
|
|
5c2e41 |
index 29e7fb4..2ffe56e 100644
|
|
|
5c2e41 |
--- a/libmpathpersist/mpath_persist.c
|
|
|
5c2e41 |
+++ b/libmpathpersist/mpath_persist.c
|
|
|
5c2e41 |
@@ -559,11 +559,10 @@ int mpath_prout_reg(struct multipath *mpp,int rq_servact, int rq_scope,
|
|
|
5c2e41 |
}
|
|
|
5c2e41 |
if (rollback && ((rq_servact == MPATH_PROUT_REG_SA) && sa_key != 0 )){
|
|
|
5c2e41 |
condlog (3, "%s: ERROR: initiating pr out rollback", mpp->wwid);
|
|
|
5c2e41 |
+ memcpy(¶mp->key, ¶mp->sa_key, 8);
|
|
|
5c2e41 |
+ memset(¶mp->sa_key, 0, 8);
|
|
|
5c2e41 |
for( i=0 ; i < count ; i++){
|
|
|
5c2e41 |
if(thread[i].param.status == MPATH_PR_SUCCESS) {
|
|
|
5c2e41 |
- memcpy(&thread[i].param.paramp->key, &thread[i].param.paramp->sa_key, 8);
|
|
|
5c2e41 |
- memset(&thread[i].param.paramp->sa_key, 0, 8);
|
|
|
5c2e41 |
- thread[i].param.status = MPATH_PR_SUCCESS;
|
|
|
5c2e41 |
rc = pthread_create(&thread[i].id, &attr, mpath_prout_pthread_fn,
|
|
|
5c2e41 |
(void *)(&thread[i].param));
|
|
|
5c2e41 |
if (rc){
|
|
|
5c2e41 |
--
|
|
|
5c2e41 |
2.7.4
|
|
|
5c2e41 |
|