[dm-devel] libmpathpersist: pthread join counts should be consistent with threads created

Xieyingtai xieyingtai at huawei.com
Tue Oct 20 12:07:35 UTC 2015


In mpath_prout_reg, it's perhaps more proper to modify active_pathcount to count which
is the actual thread counts created, otherwise it may leads to a segmentfault error.

---
libmpathpersist/mpath_persist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist
index 7a2249f..8518a2e 100644
--- a/libmpathpersist/mpath_persist.c
+++ b/libmpathpersist/mpath_persist.c
@@ -503,7 +503,7 @@ int mpath_prout_reg(struct multipath *mpp,
        count = count +1;
      }
     }
-    for( i=0; i < active_pathcount ; i++){
+    for( i=0; i < count ; i++){
      rc = pthread_join(thread[i].id, NULL);
      if (rc){
        condlog (0, "%s: Thread[%d] failed to join thread %d",
--
1.8.3.4


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20151020/1e629285/attachment.htm>


More information about the dm-devel mailing list