From: "ding.yemin" <ding.ye...@zte.com.cn>

Take the variable "conf" under RCU protection in add_map_with_path()。

Signed-off-by: ding.yemin <ding.ye...@zte.com.cn>
---
 libmultipath/structs_vec.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c
index a0c8869..b8ae87c 100644
--- a/libmultipath/structs_vec.c
+++ b/libmultipath/structs_vec.c
@@ -489,12 +489,14 @@ add_map_with_path (struct vectors * vecs,
        conf = get_multipath_config();
        mpp->mpe = find_mpe(conf->mptable, pp->wwid);
        mpp->hwe = pp->hwe;
-       put_multipath_config(conf);
 
        strcpy(mpp->wwid, pp->wwid);
        find_existing_alias(mpp, vecs);
-       if (select_alias(conf, mpp))
+       if (select_alias(conf, mpp)) {
+               put_multipath_config(conf);
                goto out;
+       }
+       put_multipath_config(conf);
        mpp->size = pp->size;
 
        if (adopt_paths(vecs->pathvec, mpp))
-- 
2.8.1.windows.1


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

Reply via email to