88821a8d11
Add 0094-libmultipath-Add-max_retries-config-option.patch * Fixes RHEL-1729 ("Allow multipathd to set the max_retries of the scsi_device for paths") Add 0095-libmutipath-Retain-device-size-if-sysfs_get_size-fai.patch Add 0096-multipathd-check-and-update-all-paths-when-in-cli_re.patch Add 0097-multipathd-move-post-reloading-commands-into-resize_.patch Add 0098-multipathd-move-resize_map-to-multipathd-main.c.patch Add 0099-multipathd-Add-auto_resize-config-option.patch * Fixes RHEL-986 ("Add option to allow multipathd to detect device resizes and autoresize.") Resolves: RHEL-986 Resolves: RHEL-1729
59 lines
1.7 KiB
Diff
59 lines
1.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Benjamin Marzinski <bmarzins@redhat.com>
|
|
Date: Thu, 9 Nov 2023 18:46:14 -0500
|
|
Subject: [PATCH] multipathd: move post-reloading commands into resize_map()
|
|
|
|
In preparation for reusing resize_map() in other code, move all code
|
|
necessary to resize the map to the resize_map() function. Also track if
|
|
map was removed in the function.
|
|
|
|
Reviewed-by: Martin Wilck <mwilck@suse.com>
|
|
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|
---
|
|
multipathd/cli_handlers.c | 16 +++++++++-------
|
|
1 file changed, 9 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c
|
|
index 93c32c5b..b08b248f 100644
|
|
--- a/multipathd/cli_handlers.c
|
|
+++ b/multipathd/cli_handlers.c
|
|
@@ -856,6 +856,10 @@ int resize_map(struct multipath *mpp, unsigned long long size,
|
|
mpp->size = orig_size;
|
|
return 1;
|
|
}
|
|
+ if (setup_multipath(vecs, mpp) != 0)
|
|
+ return 2;
|
|
+ sync_map_state(mpp);
|
|
+
|
|
return 0;
|
|
}
|
|
|
|
@@ -869,7 +873,7 @@ cli_resize(void *v, char **reply, int *len, void *data)
|
|
unsigned long long size = 0;
|
|
struct pathgroup *pgp;
|
|
struct path *pp;
|
|
- unsigned int i, j;
|
|
+ unsigned int i, j, ret;
|
|
bool mismatch = false;
|
|
|
|
mapname = convert_dev(mapname, 0);
|
|
@@ -919,14 +923,12 @@ cli_resize(void *v, char **reply, int *len, void *data)
|
|
condlog(3, "%s old size is %llu, new size is %llu", mapname, mpp->size,
|
|
size);
|
|
|
|
- if (resize_map(mpp, size, vecs) != 0)
|
|
- return 1;
|
|
+ ret = resize_map(mpp, size, vecs);
|
|
|
|
- if (setup_multipath(vecs, mpp) != 0)
|
|
- return 1;
|
|
- sync_map_state(mpp);
|
|
+ if (ret == 2)
|
|
+ condlog(0, "%s: map removed while trying to resize", mapname);
|
|
|
|
- return 0;
|
|
+ return (ret != 0);
|
|
}
|
|
|
|
int
|