Skip to contentSkip to conversation

dm-multipath: del/add map problem

DISCUSSION Applied Benjamin Marzinski 2 participants 3 messages Feb 21, 2006 – Feb 25, 2006 Device mapper

lore
Share & tools
lore

Benjamin Marzinski

author maintainer
#0 lore raw

When you delete a multipath map, orphaning the path clears out some members of the path structure. Adding that map again doesn't bring them back. Specifically, you loose your checker file descriptor.

The attached patch restores most of the members. It doesn't reset getuid. I don't see why that gets cleared in the first place? Actually, I don't see why most of these get cleared, but I didn't look too hard, so I might just be missing the reason.

Note: I cannot get multipathd add the map if it doesn't already exist in device mapper, which I assume that I'm supposed to be able to do. To see this bug, I need to re-add the map with multipath before re-adding it in multipathd. I'll look into that right after I clean up my next patch.

-Ben

author maintainer
#1 lore raw
Quoted 9 lines · Benjamin Marzinski

When you delete a multipath map, orphaning the path clears out some members of the path structure. Adding that map again doesn't bring them back. Specifically, you loose your checker file descriptor.

The attached patch restores most of the members. It doesn't reset getuid. I don't see why that gets cleared in the first place? Actually, I don't see why most of these get cleared, but I didn't look too hard, so I might just be missing the reason.

Quoted 6 lines

Note: I cannot get multipathd add the map if it doesn't already exist in device mapper, which I assume that I'm supposed to be able to do. To see this bug, I need to re-add the map with multipath before re-adding it in multipathd. I'll look into that right after I clean up my next patch.

-Ben

oops. Forgot to attach the patch. Here it is.

libmultipath/structs_vec.c +1 -0
diff -urpN mp-devel-clean/libmultipath/structs_vec.c mp-devel-patched/libmultipath/structs_vec.c
@@ -67,6 +67,7 @@ adopt_paths (vector pathvec, struct mult
 			if (!find_path_by_dev(mpp->paths, pp->dev) &&
 			    store_path(mpp->paths, pp))
 					return 1;
+			pathinfo(pp, conf->hwtable, DI_PRIO | DI_CHECKER);
 		}
 	}
 	return 0;
#2 lore raw
Quoted 7 lines · Benjamin Marzinski
Quoted 6 lines · Benjamin Marzinski

When you delete a multipath map, orphaning the path clears out some members of the path structure. Adding that map again doesn't bring them back. Specifically, you loose your checker file descriptor.

The attached patch restores most of the members. It doesn't reset getuid.

...

Quoted 2 lines

oops. Forgot to attach the patch. Here it is.
--

Applied, thanks.

Regards,
cvaroqui