|
|
21f70e |
---
|
|
|
21f70e |
libmultipath/config.c | 3 +
|
|
|
21f70e |
libmultipath/config.h | 3 +
|
|
|
21f70e |
libmultipath/configure.c | 1
|
|
|
21f70e |
libmultipath/defaults.h | 1
|
|
|
21f70e |
libmultipath/devmapper.c | 4 +-
|
|
|
21f70e |
libmultipath/dict.c | 87 +++++++++++++++++++++++++++++++++++++++++++++
|
|
|
21f70e |
libmultipath/discovery.c | 60 +++++++++++++++++++++++++++++++
|
|
|
21f70e |
libmultipath/discovery.h | 1
|
|
|
21f70e |
libmultipath/propsel.c | 25 ++++++++++++
|
|
|
21f70e |
libmultipath/propsel.h | 1
|
|
|
21f70e |
libmultipath/structs.h | 7 +++
|
|
|
21f70e |
multipath/multipath.conf.5 | 8 ++++
|
|
|
21f70e |
12 files changed, 200 insertions(+), 1 deletion(-)
|
|
|
21f70e |
|
|
|
21f70e |
Index: multipath-tools-130222/libmultipath/config.c
|
|
|
21f70e |
===================================================================
|
|
|
21f70e |
--- multipath-tools-130222.orig/libmultipath/config.c
|
|
|
21f70e |
+++ multipath-tools-130222/libmultipath/config.c
|
|
|
21f70e |
@@ -344,6 +344,7 @@ merge_hwe (struct hwentry * dst, struct
|
|
|
21f70e |
merge_num(delay_watch_checks);
|
|
|
21f70e |
merge_num(delay_wait_checks);
|
|
|
21f70e |
merge_num(skip_kpartx);
|
|
|
21f70e |
+ merge_num(max_sectors_kb);
|
|
|
21f70e |
|
|
|
21f70e |
/*
|
|
|
21f70e |
* Make sure features is consistent with
|
|
|
21f70e |
@@ -405,6 +406,7 @@ overwrite_hwe (struct hwentry * dst, str
|
|
|
21f70e |
overwrite_num(delay_watch_checks);
|
|
|
21f70e |
overwrite_num(delay_wait_checks);
|
|
|
21f70e |
overwrite_num(skip_kpartx);
|
|
|
21f70e |
+ overwrite_num(max_sectors_kb);
|
|
|
21f70e |
|
|
|
21f70e |
/*
|
|
|
21f70e |
* Make sure features is consistent with
|
|
|
d88bf6 |
@@ -682,6 +684,7 @@ load_config (char * file, struct udev *u
|
|
|
21f70e |
conf->skip_kpartx = DEFAULT_SKIP_KPARTX;
|
|
|
d88bf6 |
conf->remove_retries = 0;
|
|
|
d88bf6 |
conf->disable_changed_wwids = 0;
|
|
|
21f70e |
+ conf->max_sectors_kb = DEFAULT_MAX_SECTORS_KB;
|
|
|
21f70e |
|
|
|
21f70e |
/*
|
|
|
21f70e |
* preload default hwtable
|
|
|
21f70e |
Index: multipath-tools-130222/libmultipath/config.h
|
|
|
21f70e |
===================================================================
|
|
|
21f70e |
--- multipath-tools-130222.orig/libmultipath/config.h
|
|
|
21f70e |
+++ multipath-tools-130222/libmultipath/config.h
|
|
|
21f70e |
@@ -65,6 +65,7 @@ struct hwentry {
|
|
|
21f70e |
int delay_watch_checks;
|
|
|
21f70e |
int delay_wait_checks;
|
|
|
21f70e |
int skip_kpartx;
|
|
|
21f70e |
+ int max_sectors_kb;
|
|
|
21f70e |
char * bl_product;
|
|
|
21f70e |
};
|
|
|
21f70e |
|
|
|
21f70e |
@@ -92,6 +93,7 @@ struct mpentry {
|
|
|
21f70e |
int delay_watch_checks;
|
|
|
21f70e |
int delay_wait_checks;
|
|
|
21f70e |
int skip_kpartx;
|
|
|
21f70e |
+ int max_sectors_kb;
|
|
|
21f70e |
uid_t uid;
|
|
|
21f70e |
gid_t gid;
|
|
|
21f70e |
mode_t mode;
|
|
|
d88bf6 |
@@ -148,6 +150,7 @@ struct config {
|
|
|
21f70e |
int skip_kpartx;
|
|
|
d88bf6 |
int remove_retries;
|
|
|
d88bf6 |
int disable_changed_wwids;
|
|
|
21f70e |
+ int max_sectors_kb;
|
|
|
21f70e |
unsigned int version[3];
|
|
|
21f70e |
|
|
|
21f70e |
char * dev;
|
|
|
21f70e |
Index: multipath-tools-130222/libmultipath/configure.c
|
|
|
21f70e |
===================================================================
|
|
|
21f70e |
--- multipath-tools-130222.orig/libmultipath/configure.c
|
|
|
21f70e |
+++ multipath-tools-130222/libmultipath/configure.c
|
|
|
21f70e |
@@ -295,6 +295,7 @@ setup_map (struct multipath * mpp, char
|
|
|
21f70e |
select_delay_watch_checks(mpp);
|
|
|
21f70e |
select_delay_wait_checks(mpp);
|
|
|
21f70e |
select_skip_kpartx(mpp);
|
|
|
21f70e |
+ select_max_sectors_kb(mpp);
|
|
|
21f70e |
|
|
|
21f70e |
sysfs_set_scsi_tmo(mpp);
|
|
|
21f70e |
/*
|
|
|
21f70e |
Index: multipath-tools-130222/libmultipath/defaults.h
|
|
|
21f70e |
===================================================================
|
|
|
21f70e |
--- multipath-tools-130222.orig/libmultipath/defaults.h
|
|
|
21f70e |
+++ multipath-tools-130222/libmultipath/defaults.h
|
|
|
21f70e |
@@ -25,6 +25,7 @@
|
|
|
21f70e |
#define DEFAULT_RETRIGGER_TRIES 3
|
|
|
21f70e |
#define DEFAULT_UEV_WAIT_TIMEOUT 30
|
|
|
21f70e |
#define DEFAULT_SKIP_KPARTX SKIP_KPARTX_OFF
|
|
|
21f70e |
+#define DEFAULT_MAX_SECTORS_KB MAX_SECTORS_KB_UNDEF
|
|
|
21f70e |
|
|
|
21f70e |
#define DEFAULT_CHECKINT 5
|
|
|
21f70e |
#define MAX_CHECKINT(a) (a << 2)
|
|
|
21f70e |
Index: multipath-tools-130222/libmultipath/dict.c
|
|
|
21f70e |
===================================================================
|
|
|
21f70e |
--- multipath-tools-130222.orig/libmultipath/dict.c
|
|
|
21f70e |
+++ multipath-tools-130222/libmultipath/dict.c
|
|
|
d88bf6 |
@@ -976,6 +976,22 @@ def_disable_changed_wwids_handler(vector
|
|
|
21f70e |
return 0;
|
|
|
21f70e |
}
|
|
|
21f70e |
|
|
|
21f70e |
+static int
|
|
|
21f70e |
+def_max_sectors_kb_handler(vector strvec)
|
|
|
21f70e |
+{
|
|
|
21f70e |
+ char * buff;
|
|
|
21f70e |
+
|
|
|
21f70e |
+ buff = set_value(strvec);
|
|
|
21f70e |
+ if (!buff)
|
|
|
21f70e |
+ return 1;
|
|
|
21f70e |
+
|
|
|
21f70e |
+ if ((conf->max_sectors_kb = atoi(buff)) < MAX_SECTORS_KB_MIN)
|
|
|
21f70e |
+ conf->max_sectors_kb = MAX_SECTORS_KB_UNDEF;
|
|
|
21f70e |
+
|
|
|
21f70e |
+ FREE(buff);
|
|
|
21f70e |
+ return 0;
|
|
|
21f70e |
+}
|
|
|
21f70e |
+
|
|
|
21f70e |
/*
|
|
|
21f70e |
* blacklist block handlers
|
|
|
21f70e |
*/
|
|
|
d88bf6 |
@@ -1765,6 +1781,26 @@ hw_delay_wait_checks_handler(vector strv
|
|
|
21f70e |
return 0;
|
|
|
21f70e |
}
|
|
|
21f70e |
|
|
|
21f70e |
+static int
|
|
|
21f70e |
+hw_max_sectors_kb_handler(vector strvec)
|
|
|
21f70e |
+{
|
|
|
21f70e |
+ struct hwentry *hwe = VECTOR_LAST_SLOT(conf->hwtable);
|
|
|
21f70e |
+ char * buff;
|
|
|
21f70e |
+
|
|
|
21f70e |
+ if (!hwe)
|
|
|
21f70e |
+ return 1;
|
|
|
21f70e |
+
|
|
|
21f70e |
+ buff = set_value(strvec);
|
|
|
21f70e |
+ if (!buff)
|
|
|
21f70e |
+ return 1;
|
|
|
21f70e |
+
|
|
|
21f70e |
+ if ((hwe->max_sectors_kb = atoi(buff)) < MAX_SECTORS_KB_MIN)
|
|
|
21f70e |
+ hwe->max_sectors_kb = MAX_SECTORS_KB_UNDEF;
|
|
|
21f70e |
+
|
|
|
21f70e |
+ FREE(buff);
|
|
|
21f70e |
+ return 0;
|
|
|
21f70e |
+}
|
|
|
21f70e |
+
|
|
|
21f70e |
/*
|
|
|
21f70e |
* multipaths block handlers
|
|
|
21f70e |
*/
|
|
|
d88bf6 |
@@ -2316,6 +2352,26 @@ mp_delay_wait_checks_handler(vector strv
|
|
|
21f70e |
return 0;
|
|
|
21f70e |
}
|
|
|
21f70e |
|
|
|
21f70e |
+static int
|
|
|
21f70e |
+mp_max_sectors_kb_handler(vector strvec)
|
|
|
21f70e |
+{
|
|
|
21f70e |
+ struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable);
|
|
|
21f70e |
+ char * buff;
|
|
|
21f70e |
+
|
|
|
21f70e |
+ if (!mpe)
|
|
|
21f70e |
+ return 1;
|
|
|
21f70e |
+
|
|
|
21f70e |
+ buff = set_value(strvec);
|
|
|
21f70e |
+ if (!buff)
|
|
|
21f70e |
+ return 1;
|
|
|
21f70e |
+
|
|
|
21f70e |
+ if ((mpe->max_sectors_kb = atoi(buff)) < MAX_SECTORS_KB_MIN)
|
|
|
21f70e |
+ mpe->max_sectors_kb = MAX_SECTORS_KB_UNDEF;
|
|
|
21f70e |
+
|
|
|
21f70e |
+ FREE(buff);
|
|
|
21f70e |
+ return 0;
|
|
|
21f70e |
+}
|
|
|
21f70e |
+
|
|
|
21f70e |
/*
|
|
|
21f70e |
* config file keywords printing
|
|
|
21f70e |
*/
|
|
|
d88bf6 |
@@ -2615,6 +2671,16 @@ snprint_mp_delay_wait_checks(char * buff
|
|
|
21f70e |
}
|
|
|
21f70e |
|
|
|
21f70e |
static int
|
|
|
21f70e |
+snprint_mp_max_sectors_kb(char * buff, int len, void * data)
|
|
|
21f70e |
+{
|
|
|
21f70e |
+ struct mpentry * mpe = (struct mpentry *)data;
|
|
|
21f70e |
+
|
|
|
21f70e |
+ if (mpe->max_sectors_kb == MAX_SECTORS_KB_UNDEF)
|
|
|
21f70e |
+ return 0;
|
|
|
21f70e |
+ return snprintf(buff, len, "%d", mpe->max_sectors_kb);
|
|
|
21f70e |
+}
|
|
|
21f70e |
+
|
|
|
21f70e |
+static int
|
|
|
21f70e |
snprint_hw_fast_io_fail(char * buff, int len, void * data)
|
|
|
21f70e |
{
|
|
|
21f70e |
struct hwentry * hwe = (struct hwentry *)data;
|
|
|
d88bf6 |
@@ -2993,6 +3059,16 @@ snprint_detect_prio(char * buff, int len
|
|
|
21f70e |
}
|
|
|
21f70e |
|
|
|
21f70e |
static int
|
|
|
21f70e |
+snprint_hw_max_sectors_kb(char * buff, int len, void * data)
|
|
|
21f70e |
+{
|
|
|
21f70e |
+ struct hwentry * hwe = (struct hwentry *)data;
|
|
|
21f70e |
+
|
|
|
21f70e |
+ if (hwe->max_sectors_kb == MAX_SECTORS_KB_UNDEF)
|
|
|
21f70e |
+ return 0;
|
|
|
21f70e |
+ return snprintf(buff, len, "%d", hwe->max_sectors_kb);
|
|
|
21f70e |
+}
|
|
|
21f70e |
+
|
|
|
21f70e |
+static int
|
|
|
21f70e |
snprint_def_polling_interval (char * buff, int len, void * data)
|
|
|
21f70e |
{
|
|
|
21f70e |
return snprintf(buff, len, "%i", conf->checkint);
|
|
|
d88bf6 |
@@ -3461,6 +3537,14 @@ snprint_def_disable_changed_wwids(char *
|
|
|
21f70e |
}
|
|
|
21f70e |
|
|
|
21f70e |
static int
|
|
|
21f70e |
+snprint_def_max_sectors_kb(char * buff, int len, void * data)
|
|
|
21f70e |
+{
|
|
|
21f70e |
+ if (conf->max_sectors_kb == MAX_SECTORS_KB_UNDEF)
|
|
|
21f70e |
+ return 0;
|
|
|
21f70e |
+ return snprintf(buff, len, "%d", conf->max_sectors_kb);
|
|
|
21f70e |
+}
|
|
|
21f70e |
+
|
|
|
21f70e |
+static int
|
|
|
21f70e |
snprint_ble_simple (char * buff, int len, void * data)
|
|
|
21f70e |
{
|
|
|
21f70e |
struct blentry * ble = (struct blentry *)data;
|
|
|
d88bf6 |
@@ -3541,6 +3625,7 @@ init_keywords(void)
|
|
|
21f70e |
install_keyword("new_bindings_in_boot", &def_new_bindings_in_boot_handler, &snprint_def_new_bindings_in_boot);
|
|
|
d88bf6 |
install_keyword("remove_retries", &def_remove_retries_handler, &snprint_def_remove_retries);
|
|
|
d88bf6 |
install_keyword("disable_changed_wwids", &def_disable_changed_wwids_handler, &snprint_def_disable_changed_wwids);
|
|
|
21f70e |
+ install_keyword("max_sectors_kb", &def_max_sectors_kb_handler, &snprint_def_max_sectors_kb);
|
|
|
21f70e |
__deprecated install_keyword("default_selector", &def_selector_handler, NULL);
|
|
|
21f70e |
__deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL);
|
|
|
21f70e |
__deprecated install_keyword("default_uid_attribute", &def_uid_attribute_handler, NULL);
|
|
|
d88bf6 |
@@ -3609,6 +3694,7 @@ init_keywords(void)
|
|
|
21f70e |
install_keyword("delay_watch_checks", &hw_delay_watch_checks_handler, &snprint_hw_delay_watch_checks);
|
|
|
21f70e |
install_keyword("delay_wait_checks", &hw_delay_wait_checks_handler, &snprint_hw_delay_wait_checks);
|
|
|
21f70e |
install_keyword("skip_kpartx", &hw_skip_kpartx_handler, &snprint_hw_skip_kpartx);
|
|
|
21f70e |
+ install_keyword("max_sectors_kb", &hw_max_sectors_kb_handler, &snprint_hw_max_sectors_kb);
|
|
|
21f70e |
install_sublevel_end();
|
|
|
21f70e |
|
|
|
21f70e |
install_keyword_root("multipaths", &multipaths_handler);
|
|
|
d88bf6 |
@@ -3637,5 +3723,6 @@ init_keywords(void)
|
|
|
21f70e |
install_keyword("delay_watch_checks", &mp_delay_watch_checks_handler, &snprint_mp_delay_watch_checks);
|
|
|
21f70e |
install_keyword("delay_wait_checks", &mp_delay_wait_checks_handler, &snprint_mp_delay_wait_checks);
|
|
|
21f70e |
install_keyword("skip_kpartx", &mp_skip_kpartx_handler, &snprint_mp_skip_kpartx);
|
|
|
21f70e |
+ install_keyword("max_sectors_kb", &mp_max_sectors_kb_handler, &snprint_mp_max_sectors_kb);
|
|
|
21f70e |
install_sublevel_end();
|
|
|
21f70e |
}
|
|
|
21f70e |
Index: multipath-tools-130222/libmultipath/discovery.c
|
|
|
21f70e |
===================================================================
|
|
|
21f70e |
--- multipath-tools-130222.orig/libmultipath/discovery.c
|
|
|
21f70e |
+++ multipath-tools-130222/libmultipath/discovery.c
|
|
|
21f70e |
@@ -12,6 +12,7 @@
|
|
|
21f70e |
#include <errno.h>
|
|
|
21f70e |
#include <libgen.h>
|
|
|
21f70e |
#include <libudev.h>
|
|
|
21f70e |
+#include <libdevmapper.h>
|
|
|
21f70e |
|
|
|
21f70e |
#include "checkers.h"
|
|
|
21f70e |
#include "vector.h"
|
|
|
21f70e |
@@ -27,6 +28,7 @@
|
|
|
21f70e |
#include "discovery.h"
|
|
|
21f70e |
#include "prio.h"
|
|
|
21f70e |
#include "defaults.h"
|
|
|
21f70e |
+#include "devmapper.h"
|
|
|
21f70e |
|
|
|
21f70e |
int
|
|
|
21f70e |
store_pathinfo (vector pathvec, vector hwtable, struct udev_device *udevice,
|
|
|
21f70e |
@@ -166,6 +168,64 @@ declare_sysfs_get_str(rev);
|
|
|
21f70e |
declare_sysfs_get_str(dev);
|
|
|
21f70e |
|
|
|
21f70e |
int
|
|
|
21f70e |
+sysfs_set_max_sectors_kb(struct multipath *mpp, int is_reload)
|
|
|
21f70e |
+{
|
|
|
21f70e |
+ struct pathgroup * pgp;
|
|
|
21f70e |
+ struct path *pp;
|
|
|
21f70e |
+ char buff[11];
|
|
|
21f70e |
+ struct udev_device *udevice = NULL;
|
|
|
21f70e |
+ int i, j, len, ret;
|
|
|
21f70e |
+ int max_sectors_kb;
|
|
|
21f70e |
+
|
|
|
21f70e |
+ if (mpp->max_sectors_kb == MAX_SECTORS_KB_UNDEF)
|
|
|
21f70e |
+ return 0;
|
|
|
21f70e |
+ max_sectors_kb = mpp->max_sectors_kb;
|
|
|
21f70e |
+ if (is_reload) {
|
|
|
21f70e |
+ if (!mpp->dmi && dm_get_info(mpp->alias, &mpp->dmi) != 0) {
|
|
|
21f70e |
+ condlog(0, "failed to get dm info on %s to set max_sectors_kb", mpp->alias);
|
|
|
21f70e |
+ return 1;
|
|
|
21f70e |
+ }
|
|
|
21f70e |
+ udevice = udev_device_new_from_devnum(conf->udev, 'b',
|
|
|
21f70e |
+ makedev(mpp->dmi->major,
|
|
|
21f70e |
+ mpp->dmi->minor));
|
|
|
21f70e |
+ if (!udevice) {
|
|
|
21f70e |
+ condlog(0, "failed to get udev device to set max_sectors_kb for %s", mpp->alias);
|
|
|
21f70e |
+ return 1;
|
|
|
21f70e |
+ }
|
|
|
21f70e |
+ if (sysfs_attr_get_value(udevice, "queue/max_sectors_kb",
|
|
|
21f70e |
+ buff, sizeof(buff)) <= 0) {
|
|
|
21f70e |
+ condlog(0, "failed to get current max_sectors_kb from %s", mpp->alias);
|
|
|
21f70e |
+ goto fail_reload;
|
|
|
21f70e |
+ }
|
|
|
21f70e |
+ if (sscanf(buff, "%u\n", &max_sectors_kb) != 1) {
|
|
|
21f70e |
+ condlog(0, "can't parse current max_sectors_kb from %s",
|
|
|
21f70e |
+ mpp->alias);
|
|
|
21f70e |
+ goto fail_reload;
|
|
|
21f70e |
+ }
|
|
|
21f70e |
+ udev_device_unref(udevice);
|
|
|
21f70e |
+ }
|
|
|
21f70e |
+ snprintf(buff, 11, "%d", max_sectors_kb);
|
|
|
21f70e |
+ len = strlen(buff);
|
|
|
21f70e |
+
|
|
|
21f70e |
+ vector_foreach_slot (mpp->pg, pgp, i) {
|
|
|
21f70e |
+ vector_foreach_slot (pgp->paths, pp, j) {
|
|
|
21f70e |
+ ret = sysfs_attr_set_value(pp->udev,
|
|
|
21f70e |
+ "queue/max_sectors_kb",
|
|
|
21f70e |
+ buff, len);
|
|
|
21f70e |
+ if (ret < 0) {
|
|
|
21f70e |
+ condlog(0, "failed setting max_sectors_kb on %s : %s", pp->dev, strerror(-ret));
|
|
|
21f70e |
+ return 1;
|
|
|
21f70e |
+ }
|
|
|
21f70e |
+ }
|
|
|
21f70e |
+ }
|
|
|
21f70e |
+ return 0;
|
|
|
21f70e |
+
|
|
|
21f70e |
+fail_reload:
|
|
|
21f70e |
+ udev_device_unref(udevice);
|
|
|
21f70e |
+ return 1;
|
|
|
21f70e |
+}
|
|
|
21f70e |
+
|
|
|
21f70e |
+int
|
|
|
21f70e |
sysfs_get_timeout(struct path *pp, unsigned int *timeout)
|
|
|
21f70e |
{
|
|
|
21f70e |
const char *attr = NULL;
|
|
|
21f70e |
Index: multipath-tools-130222/libmultipath/discovery.h
|
|
|
21f70e |
===================================================================
|
|
|
21f70e |
--- multipath-tools-130222.orig/libmultipath/discovery.h
|
|
|
21f70e |
+++ multipath-tools-130222/libmultipath/discovery.h
|
|
|
21f70e |
@@ -41,6 +41,7 @@ int store_pathinfo (vector pathvec, vect
|
|
|
21f70e |
struct udev_device *udevice, int flag,
|
|
|
21f70e |
struct path **pp_ptr);
|
|
|
21f70e |
int sysfs_set_scsi_tmo (struct multipath *mpp);
|
|
|
21f70e |
+int sysfs_set_max_sectors_kb(struct multipath *mpp, int is_reload);
|
|
|
21f70e |
int sysfs_get_timeout(struct path *pp, unsigned int *timeout);
|
|
|
21f70e |
int sysfs_get_host_pci_name(struct path *pp, char *pci_name);
|
|
|
21f70e |
int sysfs_get_iscsi_ip_address(struct path *pp, char *ip_address);
|
|
|
21f70e |
Index: multipath-tools-130222/libmultipath/propsel.c
|
|
|
21f70e |
===================================================================
|
|
|
21f70e |
--- multipath-tools-130222.orig/libmultipath/propsel.c
|
|
|
21f70e |
+++ multipath-tools-130222/libmultipath/propsel.c
|
|
|
21f70e |
@@ -880,3 +880,28 @@ select_skip_kpartx (struct multipath * m
|
|
|
21f70e |
condlog(3, "skip_kpartx = DISABLED (internal default)");
|
|
|
21f70e |
return 0;
|
|
|
21f70e |
}
|
|
|
21f70e |
+
|
|
|
21f70e |
+extern int
|
|
|
21f70e |
+select_max_sectors_kb (struct multipath * mp)
|
|
|
21f70e |
+{
|
|
|
21f70e |
+ if (mp->mpe && mp->mpe->max_sectors_kb != MAX_SECTORS_KB_UNDEF) {
|
|
|
21f70e |
+ mp->max_sectors_kb = mp->mpe->max_sectors_kb;
|
|
|
21f70e |
+ condlog(3, "max_sectors_kb = %i (multipath setting)",
|
|
|
21f70e |
+ mp->max_sectors_kb);
|
|
|
21f70e |
+ return 0;
|
|
|
21f70e |
+ }
|
|
|
21f70e |
+ if (mp->hwe && mp->hwe->max_sectors_kb != MAX_SECTORS_KB_UNDEF) {
|
|
|
21f70e |
+ mp->max_sectors_kb = mp->hwe->max_sectors_kb;
|
|
|
21f70e |
+ condlog(3, "max_sectors_kb = %i (controler setting)",
|
|
|
21f70e |
+ mp->max_sectors_kb);
|
|
|
21f70e |
+ return 0;
|
|
|
21f70e |
+ }
|
|
|
21f70e |
+ if (conf->max_sectors_kb != MAX_SECTORS_KB_UNDEF) {
|
|
|
21f70e |
+ mp->max_sectors_kb = conf->max_sectors_kb;
|
|
|
21f70e |
+ condlog(3, "max_sectors_kb = %i (config file default)",
|
|
|
21f70e |
+ mp->max_sectors_kb);
|
|
|
21f70e |
+ return 0;
|
|
|
21f70e |
+ }
|
|
|
21f70e |
+ mp->max_sectors_kb = MAX_SECTORS_KB_UNDEF;
|
|
|
21f70e |
+ return 0;
|
|
|
21f70e |
+}
|
|
|
21f70e |
Index: multipath-tools-130222/libmultipath/propsel.h
|
|
|
21f70e |
===================================================================
|
|
|
21f70e |
--- multipath-tools-130222.orig/libmultipath/propsel.h
|
|
|
21f70e |
+++ multipath-tools-130222/libmultipath/propsel.h
|
|
|
21f70e |
@@ -24,3 +24,4 @@ int select_deferred_remove(struct multip
|
|
|
21f70e |
int select_delay_watch_checks (struct multipath * mp);
|
|
|
21f70e |
int select_delay_wait_checks (struct multipath * mp);
|
|
|
21f70e |
int select_skip_kpartx (struct multipath * mp);
|
|
|
21f70e |
+int select_max_sectors_kb (struct multipath * mp);
|
|
|
21f70e |
Index: multipath-tools-130222/libmultipath/structs.h
|
|
|
21f70e |
===================================================================
|
|
|
21f70e |
--- multipath-tools-130222.orig/libmultipath/structs.h
|
|
|
21f70e |
+++ multipath-tools-130222/libmultipath/structs.h
|
|
|
21f70e |
@@ -128,6 +128,12 @@ enum skip_kpartx_states {
|
|
|
21f70e |
SKIP_KPARTX_ON,
|
|
|
21f70e |
};
|
|
|
21f70e |
|
|
|
21f70e |
+
|
|
|
21f70e |
+enum max_sectors_kb_states {
|
|
|
21f70e |
+ MAX_SECTORS_KB_UNDEF = 0,
|
|
|
21f70e |
+ MAX_SECTORS_KB_MIN = 4, /* can't be smaller than page size */
|
|
|
21f70e |
+};
|
|
|
21f70e |
+
|
|
|
21f70e |
enum scsi_protocol {
|
|
|
21f70e |
SCSI_PROTOCOL_FCP = 0, /* Fibre Channel */
|
|
|
21f70e |
SCSI_PROTOCOL_SPI = 1, /* parallel SCSI */
|
|
|
d88bf6 |
@@ -245,6 +251,7 @@ struct multipath {
|
|
|
21f70e |
int delay_wait_checks;
|
|
|
21f70e |
int force_udev_reload;
|
|
|
21f70e |
int skip_kpartx;
|
|
|
21f70e |
+ int max_sectors_kb;
|
|
|
21f70e |
unsigned int dev_loss;
|
|
|
21f70e |
uid_t uid;
|
|
|
21f70e |
gid_t gid;
|
|
|
21f70e |
Index: multipath-tools-130222/multipath/multipath.conf.5
|
|
|
21f70e |
===================================================================
|
|
|
21f70e |
--- multipath-tools-130222.orig/multipath/multipath.conf.5
|
|
|
21f70e |
+++ multipath-tools-130222/multipath/multipath.conf.5
|
|
|
45d01a |
@@ -567,6 +567,10 @@ disable access to the path until the wwi
|
|
|
d88bf6 |
This sets how may times multipath will retry removing a device that is in-use.
|
|
|
d88bf6 |
Between each attempt, multipath will sleep 1 second. The default is
|
|
|
d88bf6 |
.I 0
|
|
|
21f70e |
+.TP
|
|
|
21f70e |
+.B max_sectors_kb
|
|
|
21f70e |
+Sets the max_sectors_kb device parameter on all path devices and the multipath
|
|
|
21f70e |
+device to the specified value. Default is device dependent.
|
|
|
21f70e |
.
|
|
|
21f70e |
.SH "blacklist section"
|
|
|
21f70e |
The
|
|
|
45d01a |
@@ -678,6 +682,8 @@ section:
|
|
|
21f70e |
.B delay_wait_checks
|
|
|
21f70e |
.TP
|
|
|
21f70e |
.B skip_kpartx
|
|
|
21f70e |
+.TP
|
|
|
21f70e |
+.B max_sectors_kb
|
|
|
21f70e |
.RE
|
|
|
21f70e |
.PD
|
|
|
21f70e |
.LP
|
|
|
45d01a |
@@ -778,6 +784,8 @@ section:
|
|
|
21f70e |
.B delay_wait_checks
|
|
|
21f70e |
.TP
|
|
|
21f70e |
.B skip_kpartx
|
|
|
21f70e |
+.TP
|
|
|
21f70e |
+.B max_sectors_kb
|
|
|
21f70e |
.RE
|
|
|
21f70e |
.PD
|
|
|
21f70e |
.LP
|
|
|
21f70e |
Index: multipath-tools-130222/libmultipath/devmapper.c
|
|
|
21f70e |
===================================================================
|
|
|
21f70e |
--- multipath-tools-130222.orig/libmultipath/devmapper.c
|
|
|
21f70e |
+++ multipath-tools-130222/libmultipath/devmapper.c
|
|
|
21f70e |
@@ -21,7 +21,7 @@
|
|
|
21f70e |
#include "devmapper.h"
|
|
|
21f70e |
#include "config.h"
|
|
|
21f70e |
#include "sysfs.h"
|
|
|
21f70e |
-
|
|
|
21f70e |
+#include "discovery.h"
|
|
|
21f70e |
#include "log_pthread.h"
|
|
|
21f70e |
#include <sys/types.h>
|
|
|
21f70e |
#include <time.h>
|
|
|
21f70e |
@@ -330,6 +330,7 @@ extern int
|
|
|
21f70e |
dm_addmap_create (struct multipath *mpp, char * params) {
|
|
|
21f70e |
int ro;
|
|
|
21f70e |
|
|
|
21f70e |
+ sysfs_set_max_sectors_kb(mpp, 0);
|
|
|
21f70e |
for (ro = 0; ro <= 1; ro++) {
|
|
|
21f70e |
int err;
|
|
|
21f70e |
|
|
|
21f70e |
@@ -356,6 +357,7 @@ dm_addmap_create (struct multipath *mpp,
|
|
|
21f70e |
|
|
|
21f70e |
extern int
|
|
|
21f70e |
dm_addmap_reload (struct multipath *mpp, char *params) {
|
|
|
21f70e |
+ sysfs_set_max_sectors_kb(mpp, 1);
|
|
|
21f70e |
if (dm_addmap(DM_DEVICE_RELOAD, TGT_MPATH, mpp, params, 0, ADDMAP_RW, SKIP_KPARTX_OFF))
|
|
|
21f70e |
return 1;
|
|
|
21f70e |
if (errno != EROFS)
|