dm-multipath [PATCH] "better" return codes.
Benjamin Marzinski
maintainerI think that these multipathd return codes make more sense (failing if the map is not a multipath map, and not failing if it has already been added).
-Ben
multipathd/main.c +2 -2
@@ -569,7 +569,7 @@ ev_add_map (char * devname, struct vectoif (map_present &&dm_type (alias,DEFAULT_TARGET ) <=0 ) {condlog (4 ,"%s: not a multipath map" , alias);FREE (alias); -return 0 ; +return 1 ; } mpp =find_mp_by_alias (vecs->mpvec, alias);
@@ -709,7 +709,7 @@ ev_add_path (char * devname, struct vect/* * allow reconfig of orphaned path here */ -if (pp->mpp)return 1 ; +if (pp->mpp)return 0 ; }else {/*
Quoted 9 lines · Benjamin Marzinski
I think that these multipathd return codes make more sense (failing if the map is not a multipath map, and not failing if it has already been added).
-Ben
diff -urpN
mp-devel-clean/multipathd/main.cmp-devel-patched/multipathd/main.c
multipathd/main.c ev_add_map (char * devname, struct vecto · line 574
Quoted 7 lines
multipathd/main.c +1
-1@@ -569,7 +569,7 @@ ev_add_map (char * devname, struct vectoif (map_present &&dm_type (alias,DEFAULT_TARGET ) <=0 ) {condlog (4 ,"%s: not a multipath map" , alias);FREE (alias); -return 0 ; +return 1 ; }
Returning ok here means the event needs no treatment and it's ok. Seems right to me.
multipathd/main.c ev_add_path (char * devname, struct vect · line 715
Quoted 10 lines
multipathd/main.c +1
-1mpp =find_mp_by_alias (vecs->mpvec, alias);@@ -709,7 +709,7 @@ ev_add_path (char * devname, struct vect/* * allow reconfig of orphaned path here */ -if (pp->mpp)return 1 ; +if (pp->mpp)return 0 ; }else {/*
Indeed, the comment looks wrong wrt actual code.
Regards,
cvaroqui