Fix auto resize code
Benjamin Marzinski
maintainerv2 cover Fix auto resize code
Fix two bugs in my auto-resize feature.
changes from v1 (based on suggestions from Martin Wilck):
0002: Explicitly set the default values of auto_resize
Benjamin Marzinski (2):
multipathd: fix null pointer dereference in uev_update_path
multipathd: fix auto-resize configuration
libmultipath/config.c | 1 + libmultipath/structs.h | 1 - multipathd/main.c | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.43.0
Benjamin Marzinski
maintainerPATCH v2 1/2 multipathd: fix null pointer dereference in uev_update_path
The Auto-resize code added a check that deferences pp->mpp without checking that it's non-NULL. Fix it.
--- multipathd/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
multipathd/main.c +1 -1
@@ -1630,7 +1630,7 @@ uev_update_path (struct uevent *uev, struct vectors * vecs) } } } -if (auto_resize !=AUTO_RESIZE_NEVER && +if (auto_resize !=AUTO_RESIZE_NEVER && mpp && !mpp->wait_for_udev) {struct pathgroup *pgp;struct path *pp2;
Signature · 1 line
2.43.0
Benjamin Marzinski
maintainerPATCH v2 2/2 multipathd: fix auto-resize configuration
In reply to Benjamin MarzinskiThe code acted like AUTO_RESIZE_UNDEFINED didn't exist, but since conf->auto_resize was never set to AUTO_RESIZE_NEVER, the default was in fact AUTO_RESIZE_UNDEFINED, which ended up getting treated like AUTO_RESIZE_GROW_SHRINK. Remove AUTO_RESIZE_UNDEFINED and explicitly default auto_resize tp AUTO_RESIZE_NEVER.
--- libmultipath/config.c | 1 + libmultipath/structs.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-)
libmultipath/config.c +1 -0
@@ -927,6 +927,7 @@ int _init_config (const char *file, struct config *conf) conf->retrigger_tries =DEFAULT_RETRIGGER_TRIES ; conf->retrigger_delay =DEFAULT_RETRIGGER_DELAY ; conf->uev_wait_timeout =DEFAULT_UEV_WAIT_TIMEOUT ; + conf->auto_resize =DEFAULT_AUTO_RESIZE ; conf->remove_retries =0 ; conf->ghost_delay =DEFAULT_GHOST_DELAY ; conf->all_tg_pt =DEFAULT_ALL_TG_PT ;
libmultipath/structs.h +0 -1
@@ -180,7 +180,6 @@ enum queue_mode_states { };enum auto_resize_state { -AUTO_RESIZE_UNDEF =0 ,AUTO_RESIZE_NEVER ,AUTO_RESIZE_GROW_ONLY ,AUTO_RESIZE_GROW_SHRINK ,
Signature · 1 line
2.43.0
Quoted 5 lines · Benjamin Marzinski
Fix two bugs in my auto-resize feature.
changes from v1 (based on suggestions from Martin Wilck):
0002: Explicitly set the default values ofauto_resize
Quoted 9 lines
Benjamin Marzinski (2):
multipathd: fix null pointer dereference inuev_update_path
multipathd: fix auto-resize configurationlibmultipath/config.c | 1 +
libmultipath/structs.h | 1 -
multipathd/main.c | 2 +-3 files changed, 2 insertions(+), 2 deletions(-)
For the series: