[dm-devel] [PATCH 03/10] do not allow in-use path to change wwid

Benjamin Marzinski bmarzins at redhat.com
Sat Oct 29 02:55:19 UTC 2016


When a path is part of a multipath device, it must not change it's wwid.
If it can, when multipathd is reconfigured, you can end up with two
multipath devices owning the same path, eventually leading to a crash.

Signed-off-by: Benjamin Marzinski <bmarzins at redhat.com>
---
 libmultipath/dmparser.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libmultipath/dmparser.c b/libmultipath/dmparser.c
index 9e79ecd..87e8398 100644
--- a/libmultipath/dmparser.c
+++ b/libmultipath/dmparser.c
@@ -380,6 +380,14 @@ disassemble_map (vector pathvec, char * params, struct multipath * mpp,
 				strncpy(pp->wwid, mpp->wwid,
 					WWID_SIZE - 1);
 
+			/*
+			 * Do not allow in-use patch to change wwid
+			 */
+			else if (strcmp(pp->wwid, mpp->wwid) != 0) {
+				condlog(0, "%s: path wwid appears to have changed. Using map wwid.\n", pp->dev_t);
+				strncpy(pp->wwid, mpp->wwid, WWID_SIZE);
+			}
+
 			pgp->id ^= (long)pp;
 			pp->pgindex = i + 1;
 
-- 
1.8.3.1




More information about the dm-devel mailing list