aba856f28c
Modify 0015-RH-fix-output-buffer.patch * Fix memory leak Add 0048-RH-print-defaults.patch Add 0049-RH-remove-ID_FS_TYPE.patch * remove ID_FS_TYPE udev enviroment variable for multipath devices Add 0051-UP-fix-cli-resize.patch * check before dereferencing variables Add 0052-RH-fix-bad-derefs.patch * setup multipath free the multipath device when it fails, so don't keep using it. Add 0053-UP-fix-failback.patch * setting failback in the devices section was broken Add 0054-UP-keep-udev-ref.patch * multipathd needs to keep the same udev object across reconfigures Add 0055-UP-handle-quiesced-paths.patch * quiesced paths should be treated as down Add 0056-UP-alua-prio-fix.patch * Don't count the preferred bit for paths that are active/optimized Add 0057-UP-fix-tmo.patch * Cleanup how multipath sets dev_loss_tmo and fast_io_fail_tmo. Also make multipath get changing values directly from sysfs, instead of from udev, which caches them. Add 0058-UP-fix-failback.patch * make failback print the default value when you show configs. Add 0059-UP-flush-failure-queueing.patch * If you can't flush a multipath device, restore the queue_if_no_paths value Add 0060-UP-uevent-loop-udev.patch * make ueventloop grab it's own udev reference, since it is cancelled asychnrously.
72 lines
2.3 KiB
Diff
72 lines
2.3 KiB
Diff
---
|
|
libmultipath/devmapper.c | 21 +++++++++++++++++----
|
|
libmultipath/devmapper.h | 2 +-
|
|
2 files changed, 18 insertions(+), 5 deletions(-)
|
|
|
|
Index: multipath-tools-130222/libmultipath/devmapper.c
|
|
===================================================================
|
|
--- multipath-tools-130222.orig/libmultipath/devmapper.c
|
|
+++ multipath-tools-130222/libmultipath/devmapper.c
|
|
@@ -363,7 +363,7 @@ out:
|
|
}
|
|
|
|
extern int
|
|
-dm_get_map(char * name, unsigned long long * size, char * outparams)
|
|
+dm_get_map(const char * name, unsigned long long * size, char * outparams)
|
|
{
|
|
int r = 1;
|
|
struct dm_task *dmt;
|
|
@@ -682,7 +682,9 @@ _dm_flush_map (const char * mapname, int
|
|
extern int
|
|
dm_suspend_and_flush_map (const char * mapname)
|
|
{
|
|
- int s;
|
|
+ int s = 0, queue_if_no_path = 0;
|
|
+ unsigned long long mapsize;
|
|
+ char params[PARAMS_SIZE] = {0};
|
|
|
|
if (!dm_map_present(mapname))
|
|
return 0;
|
|
@@ -690,8 +692,17 @@ dm_suspend_and_flush_map (const char * m
|
|
if (dm_type(mapname, TGT_MPATH) <= 0)
|
|
return 0; /* nothing to do */
|
|
|
|
- s = dm_queue_if_no_path((char *)mapname, 0);
|
|
- if (!s)
|
|
+ if (!dm_get_map(mapname, &mapsize, params)) {
|
|
+ if (strstr(params, "queue_if_no_path"))
|
|
+ queue_if_no_path = 1;
|
|
+ }
|
|
+
|
|
+ if (queue_if_no_path)
|
|
+ s = dm_queue_if_no_path((char *)mapname, 0);
|
|
+ /* Leave queue_if_no_path alone if unset failed */
|
|
+ if (s)
|
|
+ queue_if_no_path = 0;
|
|
+ else
|
|
s = dm_simplecmd_flush(DM_DEVICE_SUSPEND, mapname, 0);
|
|
|
|
if (!dm_flush_map(mapname)) {
|
|
@@ -700,6 +711,8 @@ dm_suspend_and_flush_map (const char * m
|
|
}
|
|
condlog(2, "failed to remove multipath map %s", mapname);
|
|
dm_simplecmd_noflush(DM_DEVICE_RESUME, mapname);
|
|
+ if (queue_if_no_path)
|
|
+ s = dm_queue_if_no_path((char *)mapname, 1);
|
|
return 1;
|
|
}
|
|
|
|
Index: multipath-tools-130222/libmultipath/devmapper.h
|
|
===================================================================
|
|
--- multipath-tools-130222.orig/libmultipath/devmapper.h
|
|
+++ multipath-tools-130222/libmultipath/devmapper.h
|
|
@@ -14,7 +14,7 @@ int dm_simplecmd_noflush (int, const cha
|
|
int dm_addmap_create (struct multipath *mpp, char *params);
|
|
int dm_addmap_reload (struct multipath *mpp, char *params);
|
|
int dm_map_present (const char *);
|
|
-int dm_get_map(char *, unsigned long long *, char *);
|
|
+int dm_get_map(const char *, unsigned long long *, char *);
|
|
int dm_get_status(char *, char *);
|
|
int dm_type(const char *, char *);
|
|
int _dm_flush_map (const char *, int);
|