device-mapper-multipath-0.8.7-27

Add 0105-multipathd-fix-null-pointer-dereference-in-uev_updat.patch
Add 0106-multipathd-fix-auto-resize-configuration.patch
Add 0107-libmultipath-fix-displaying-auto_resize-config-setti.patch
  * Fixes RHEL-986 ("Add option to allow multipathd to detect device
    resizes and autoresize.")
Resolves: RHEL-986
This commit is contained in:
Benjamin Marzinski 2024-01-26 16:52:21 -05:00
parent dbdf7ab1ce
commit c1d4bd6a3c
4 changed files with 111 additions and 1 deletions

View File

@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Tue, 16 Jan 2024 20:19:11 -0500
Subject: [PATCH] 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.
Fixes: 981b83ad1 ("multipathd: Add auto_resize config option")
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Reviewed-by: Martin Wilck <mwilck@suse.com>
---
multipathd/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/multipathd/main.c b/multipathd/main.c
index 3eeca82f..26be6dc3 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -1487,7 +1487,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;

View File

@ -0,0 +1,43 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Tue, 16 Jan 2024 20:19:12 -0500
Subject: [PATCH] multipathd: fix auto-resize configuration
The 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.
Fixes: 981b83ad1 ("multipathd: Add auto_resize config option")
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Reviewed-by: Martin Wilck <mwilck@suse.com>
---
libmultipath/config.c | 1 +
libmultipath/structs.h | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/libmultipath/config.c b/libmultipath/config.c
index 61b0dd51..f31200a3 100644
--- a/libmultipath/config.c
+++ b/libmultipath/config.c
@@ -940,6 +940,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;
diff --git a/libmultipath/structs.h b/libmultipath/structs.h
index 8c2d7131..d2ad4867 100644
--- a/libmultipath/structs.h
+++ b/libmultipath/structs.h
@@ -168,7 +168,6 @@ enum queue_mode_states {
};
enum auto_resize_state {
- AUTO_RESIZE_UNDEF = 0,
AUTO_RESIZE_NEVER,
AUTO_RESIZE_GROW_ONLY,
AUTO_RESIZE_GROW_SHRINK,

View File

@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Fri, 26 Jan 2024 15:40:42 -0500
Subject: [PATCH] libmultipath: fix displaying auto_resize config setting
When 56476ebd3 ("multipathd: fix auto-resize configuration") removed
AUTO_RESIZE_UNDEFINED, it didn't update print_auto_resize() to print
a value for when it was set to 0 (which is now AUTO_RESIZE_NEVER).
Fixes: 56476ebd3 ("multipathd: fix auto-resize configuration")
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/dict.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/libmultipath/dict.c b/libmultipath/dict.c
index c4db60df..ce1b6c99 100644
--- a/libmultipath/dict.c
+++ b/libmultipath/dict.c
@@ -1763,8 +1763,6 @@ def_auto_resize_handler(struct config *conf, vector strvec, const char *file,
int
print_auto_resize(struct strbuf *buff, long v)
{
- if (!v)
- return 0;
return append_strbuf_quoted(buff,
v == AUTO_RESIZE_GROW_ONLY ? "grow_only" :
v == AUTO_RESIZE_GROW_SHRINK ? "grow_shrink" :

View File

@ -1,6 +1,6 @@
Name: device-mapper-multipath
Version: 0.8.7
Release: 26%{?dist}
Release: 27%{?dist}
Summary: Tools to manage multipath devices using device-mapper
License: GPLv2
URL: http://christophe.varoqui.free.fr/
@ -114,6 +114,9 @@ Patch0101: 0101-multipathd-Make-sure-to-disable-queueing-if-recovery.patch
Patch0102: 0102-multipathd-remove-nopath-flushing-code-from-flush_ma.patch
Patch0103: 0103-multipathd-make-flush_map-delete-maps-like-the-multi.patch
Patch0104: 0104-multipathd-disable-queueing-when-removing-unknown-ma.patch
Patch0105: 0105-multipathd-fix-null-pointer-dereference-in-uev_updat.patch
Patch0106: 0106-multipathd-fix-auto-resize-configuration.patch
Patch0107: 0107-libmultipath-fix-displaying-auto_resize-config-setti.patch
# runtime
@ -317,6 +320,14 @@ fi
%{_pkgconfdir}/libdmmp.pc
%changelog
* Fri Jan 26 2024 Benjamin Marzinski <bmarzins@redhat.com> - 0.8.7-27
- Add 0105-multipathd-fix-null-pointer-dereference-in-uev_updat.patch
- Add 0106-multipathd-fix-auto-resize-configuration.patch
- Add 0107-libmultipath-fix-displaying-auto_resize-config-setti.patch
* Fixes RHEL-986 ("Add option to allow multipathd to detect device
resizes and autoresize.")
- Resolves: RHEL-986
* Wed Jan 3 2024 Benjamin Marzinski <bmarzins@redhat.com> - 0.8.7-26
- Add 0100-libmultipath-avoid-temporarily-enabling-queueing-on-.patch
- Add 0101-multipathd-Make-sure-to-disable-queueing-if-recovery.patch