[PATCH] RCU protection for variable conf in add_map_with_path()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "ding.yemin" <ding.yemin@xxxxxxxxxx>

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

Signed-off-by: ding.yemin <ding.yemin@xxxxxxxxxx>
---
 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@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux