Skip to contentSkip to conversation

Multipath patch dump

PATCH In review Benjamin Marzinski 2 participants 20 messages Feb 19, 2020 Device mapper

lore
Share & tools
lore

Benjamin Marzinski

author maintainer
#0 lore raw

v3 cover Multipath patch dump

This patch set is has multiple parts.

patch 01 is just a resubmit of my previous patch, with Martin's corrections added.

Patches 02 - 06 are miscellaneous fixes and cleanups

Patches 07 - 09 are related to adding a new format wildcard, at the
request of HPE, that allows multipath to get and display information from the vendor specific VPD pages

Patches 10 - 18 are the part that needs the most review, patch 14
especially. It turns out that on machines with a large number of cores, io_destroy(), which is used by the directio checker, can take a long time to complete. Talking to some kernel people at Red Hat, I was told that this isn't a bug. It's working as expected, and multipath shouldn't be issuing so many io_destroy() calls (1 per path, when multipath or multipathd stops). Cutting out the io_destroy calls involved a major change to the directio checker. It's pretty hard to test a lot of the corner cases on actual hardware, so I've written a bunch of unit tests for this (patches 16 & 17).

Changes in v3:
This removes the conflicts with Martin's earlier patches, specifically

0003-libmultipath-fix-leak-in-foreign-code.patch
removed in favor of Martin's
"libmultipath: _init_foreign(): fix possible memory leak" patch

0016-fixup-libmultipath-add-code-to-get-vendor-specific-v.patch 0017-fixup-libmultipath-make-directio-checker-share-io-co.patch
New patches to fix compile-time errors resulting from the rebase

0018-tests-make-directio-tests-able-to-work-on-a-real-dev.patch
Fix conflicts between with Martin's earlier patches

Changes in v2:
0001-multipathd-warn-when-configuration-has-been-changed.patch
Changed to reflect Martin Wilck's comments

0002-multipathd-staticify-uxlsnr-variables-functions.patch
New patch

0008-libmultipath-fix-sgio_get_vpd-looping.patch
Test has been changed to keep create_vpd83 the same, and overwrite the length in the actual test, as suggested by Martin Wilck

0010-libmultipath-add-code-to-get-vendor-specific-vpd-dat.patch

	The information to find the vpd page and how to decode it is
	now simply the index in a table of name -> page_nr mappings

0012-libmultipath-change-failed-path-prio-timeout.patch
The timeout argument has been renamed to avoid confusion, as suggested by Martin Wilck

0015-libmultipath-make-directio-checker-share-io-contexts.patch
Minor changes to print more useful messages, and avoid printing anything when we get a non-zero io_cancel() result, as suggested by Martin Wilck

0016-tests-add-directio-unit-tests.patch
Minor change to improve readability, as suggested by Martin Wilck

0017-tests-make-directio-tests-able-to-work-on-a-real-dev.patch
New patch. This adds the ability to set a testing device, so you can run the directio tests on an actual device

Benjamin Marzinski (16):
multipathd: warn when configuration has been changed.
multipathd: staticify uxlsnr variables/functions Fix leak in mpathpersist
libmultipath: remove unused path->prio_args
libmultipath: constify get_unaligned_be*
libmultipath: add missing hwe mpe variable merges
libmultipath: fix sgio_get_vpd looping
libmultipath: add vend_id to get_vpd_sgio
libmultipath: add code to get vendor specific vpd data
libmultipath: change how the checker async is set
libmultipath: change failed path prio timeout
multipathd: add new paths under vecs lock
libmultipath: add new checker class functions
libmultipath: make directio checker share io contexts
tests: add directio unit tests
tests: make directio tests able to work on a real device

Martin Wilck (2):
fixup! libmultipath: add code to get vendor specific vpd data fixup! libmultipath: make directio checker share io contexts

 libmpathpersist/mpath_persist.c  |   2 +-
 libmultipath/checkers.c          |  29 +-
 libmultipath/checkers.h          |   1 +
 libmultipath/checkers/directio.c | 336 ++++++++++---
 libmultipath/config.c            |  10 +
 libmultipath/config.h            |   2 +
 libmultipath/dict.c              |  38 ++
 libmultipath/discovery.c         |  80 ++-
 libmultipath/discovery.h         |   2 +-
 libmultipath/hwtable.c           |   1 +
 libmultipath/print.c             |  25 +
 libmultipath/prio.c              |   6 +-
 libmultipath/propsel.c           |  20 +-
 libmultipath/propsel.h           |   1 +
 libmultipath/structs.h           |  16 +-
 libmultipath/unaligned.h         |   4 +-
 mpathpersist/main.c              |   1 +
 multipath/main.c                 |   1 +
 multipath/multipath.conf.5       |  15 +-
 multipathd/main.c                |  18 +-
 multipathd/uxlsnr.c              | 150 +++++-
 tests/Makefile                   |  19 +-
 tests/directio.c                 | 812 +++++++++++++++++++++++++++++++
 tests/directio_test_dev          |   4 +
 tests/vpd.c                      |  87 ++--
 25 files changed, 1527 insertions(+), 153 deletions(-)
 create mode 100644 tests/directio.c
 create mode 100644 tests/directio_test_dev
Signature · 1 line
2.17.2
author maintainer
#1 lore raw

PATCH v3 1/18 multipathd: warn when configuration has been changed.

It would be helpful if multipathd could log a message when multipath.conf or files in the config_dir have been written to, both so that it can be used to send a notification to users, and to help with determining after the fact if multipathd was running with an older config, when the logs of multipathd's behaviour don't match with the current multipath.conf.

To do this, the multipathd uxlsnr thread now sets up inotify watches on both /etc/multipath.conf and the config_dir to watch if the files are deleted or closed after being opened for writing. In order to keep uxlsnr from polling repeatedly if the multipath.conf or the config_dir aren't present, it will only set up the watches once per reconfigure. However, since multipath.conf is far more likely to be replaced by a text editor than modified in place, if it gets removed, multipathd will immediately try to restart the watch on it (which will succeed if the file was simply replaced by a new copy). This does mean that if multipath.conf or the config_dir are actually removed and then later re-added, multipathd won't log any more messages for changes until the next reconfigure. But that seems like a fair trade-off to avoid repeatedly polling for files that aren't likely to appear.

---
 libmultipath/config.h |   1 +
 multipathd/main.c     |   1 +
 multipathd/uxlsnr.c   | 138 ++++++++++++++++++++++++++++++++++++++++--
 3 files changed, 134 insertions(+), 6 deletions(-)
libmultipath/config.h +1 -0
index a078947c..853febf2 100644
@@ -189,6 +189,7 @@ struct config {
 	int find_multipaths_timeout;
 	int marginal_pathgroups;
 	unsigned int version[3];
+	unsigned int sequence_nr;
 
 	char * multipath_dir;
 	char * selector;
multipathd/main.c +1 -0
index 95426d3d..a590ba8d 100644
@@ -2586,6 +2586,7 @@ reconfigure (struct vectors * vecs)
 	uxsock_timeout = conf->uxsock_timeout;
 
 	old = rcu_dereference(multipath_conf);
+	conf->sequence_nr = old->sequence_nr + 1;
 	rcu_assign_pointer(multipath_conf, conf);
 	call_rcu(&old->rcu, rcu_free_config);
 
multipathd/uxlsnr.c +132 -6

208 lines not on this page · raw message

Signature · 1 line
2.17.2
author maintainer
#2 lore raw

PATCH v3 2/18 multipathd: staticify uxlsnr variables/functions

In reply to Benjamin Marzinski
---
 multipathd/uxlsnr.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
multipathd/uxlsnr.c +6 -6
index 020d7a9b..1c5ce9d2 100644
@@ -40,7 +40,7 @@
 #include "cli.h"
 #include "uxlsnr.h"
 
-struct timespec sleep_time = {5, 0};
+static struct timespec sleep_time = {5, 0};
 
 struct client {
 	struct list_head node;
@@ -49,9 +49,9 @@ struct client {
 
 #define MIN_POLLS 1023
 
-LIST_HEAD(clients);
-pthread_mutex_t client_lock = PTHREAD_MUTEX_INITIALIZER;
-struct pollfd *polls;
+static LIST_HEAD(clients);
+static pthread_mutex_t client_lock = PTHREAD_MUTEX_INITIALIZER;
+static struct pollfd *polls;
 static int notify_fd = -1;
 static char *watch_config_dir;
 
@@ -122,13 +122,13 @@ static void dead_client(struct client *c)
 	pthread_cleanup_pop(1);
 }
 
-void free_polls (void)
+static void free_polls (void)
 {
 	if (polls)
 		FREE(polls);
 }
 
-void check_timeout(struct timespec start_time, char *inbuf,
+static void check_timeout(struct timespec start_time, char *inbuf,
 		   unsigned int timeout)
 {
 	struct timespec diff_time, end_time;
Signature · 1 line
2.17.2
author maintainer
#3 lore raw

PATCH v3 3/18 Fix leak in mpathpersist

In reply to Benjamin Marzinski

If the persistent in command fails, the response buffer must be freed. Found by Coverity

---
 mpathpersist/main.c | 1 +
 1 file changed, 1 insertion(+)
mpathpersist/main.c +1 -0
index 56761668..28bfe410 100644
@@ -499,6 +499,7 @@ static int handle_args(int argc, char * argv[], int nline)
 		if (ret != MPATH_PR_SUCCESS )
 		{
 			fprintf (stderr, "Persistent Reserve IN command failed\n");
+			free(resp);
 			goto out_fd;
 		}
 
Signature · 1 line
2.17.2
author maintainer
#4 lore raw

PATCH v3 4/18 libmultipath: remove unused path->prio_args

In reply to Benjamin Marzinski
---
 libmultipath/structs.h | 1 -
 1 file changed, 1 deletion(-)
libmultipath/structs.h +0 -1
index c978fb8a..250623af 100644
@@ -273,7 +273,6 @@ struct path {
 	char * uid_attribute;
 	char * getuid;
 	struct prio prio;
-	char * prio_args;
 	struct checker checker;
 	struct multipath * mpp;
 	int fd;
Signature · 1 line
2.17.2
author maintainer
#5 lore raw

PATCH v3 5/18 libmultipath: constify get_unaligned_be*

In reply to Benjamin Marzinski
---
 libmultipath/unaligned.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
libmultipath/unaligned.h +2 -2
index 68c07742..b9eaa7cb 100644
@@ -10,14 +10,14 @@ static inline uint16_t get_unaligned_be16(const void *ptr)
 	return p[0] << 8 | p[1];
 }
 
-static inline uint32_t get_unaligned_be32(void *ptr)
+static inline uint32_t get_unaligned_be32(const void *ptr)
 {
 	const uint8_t *p = ptr;
 
 	return p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3];
 }
 
-static inline uint64_t get_unaligned_be64(void *ptr)
+static inline uint64_t get_unaligned_be64(const void *ptr)
 {
 	uint32_t low = get_unaligned_be32(ptr + 4);
 	uint64_t high = get_unaligned_be32(ptr);
Signature · 1 line
2.17.2
author maintainer
#6 lore raw

PATCH v3 6/18 libmultipath: add missing hwe mpe variable merges

In reply to Benjamin Marzinski

There were some variables in the hwe and mpe structs that weren't being merged by merge_hwe() and merge_mpe().

---
 libmultipath/config.c | 8 ++++++++
 1 file changed, 8 insertions(+)
libmultipath/config.c +8 -0
index dc64ef59..366f4e30 100644
@@ -372,6 +372,10 @@ merge_hwe (struct hwentry * dst, struct hwentry * src)
 	merge_num(san_path_err_threshold);
 	merge_num(san_path_err_forget_rate);
 	merge_num(san_path_err_recovery_time);
+	merge_num(marginal_path_err_sample_time);
+	merge_num(marginal_path_err_rate_threshold);
+	merge_num(marginal_path_err_recheck_gap_time);
+	merge_num(marginal_path_double_failed_time);
 
 	snprintf(id, sizeof(id), "%s/%s", dst->vendor, dst->product);
 	reconcile_features_with_options(id, &dst->features,
@@ -397,6 +401,7 @@ merge_mpe(struct mpentry *dst, struct mpentry *src)
 	if (dst->prkey_source == PRKEY_SOURCE_NONE &&
 	    src->prkey_source != PRKEY_SOURCE_NONE) {
 		dst->prkey_source = src->prkey_source;
+		dst->sa_flags = src->sa_flags;
 		memcpy(&dst->reservation_key, &src->reservation_key,
 		       sizeof(dst->reservation_key));
 	}
@@ -413,6 +418,9 @@ merge_mpe(struct mpentry *dst, struct mpentry *src)
 	merge_num(deferred_remove);
 	merge_num(delay_watch_checks);
 	merge_num(delay_wait_checks);
+	merge_num(san_path_err_threshold);
+	merge_num(san_path_err_forget_rate);
+	merge_num(san_path_err_recovery_time);
 	merge_num(marginal_path_err_sample_time);
 	merge_num(marginal_path_err_rate_threshold);
 	merge_num(marginal_path_err_recheck_gap_time);
Signature · 1 line
2.17.2
author maintainer
#7 lore raw

PATCH v3 7/18 libmultipath: fix sgio_get_vpd looping

In reply to Benjamin Marzinski

If do_inq returns a page with a length that is less than maxlen, but larger than DEFAULT_SGIO_LEN, this function will loop forever. Also if do_inq returns with a length equal to or greater than maxlen, sgio_get_vpd will exit immediately, even if it hasn't read the entire page. Fix these issues, modify the tests to verify the new behavior.

---
 libmultipath/discovery.c | 12 +++----
 tests/vpd.c              | 77 ++++++++++++++++++++++++----------------
 2 files changed, 52 insertions(+), 37 deletions(-)
libmultipath/discovery.c +6 -6
index 5f41dcb7..19a8d2af 100644
@@ -928,6 +928,7 @@ static int
 sgio_get_vpd (unsigned char * buff, int maxlen, int fd, int pg)
 {
 	int len = DEFAULT_SGIO_LEN;
+	int rlen;
 
 	if (fd < 0) {
 		errno = EBADF;
@@ -935,12 +936,11 @@ sgio_get_vpd (unsigned char * buff, int maxlen, int fd, int pg)
 	}
 retry:
 	if (0 == do_inq(fd, 0, 1, pg, buff, len)) {
-		len = get_unaligned_be16(&buff[2]) + 4;
-		if (len >= maxlen)
-			return len;
-		if (len > DEFAULT_SGIO_LEN)
-			goto retry;
-		return len;
+		rlen = get_unaligned_be16(&buff[2]) + 4;
+		if (rlen <= len || len >= maxlen)
+			return rlen;
+		len = (rlen < maxlen)? rlen : maxlen;
+		goto retry;
 	}
 	return -1;
 }
tests/vpd.c +46 -31

110 lines not on this page · raw message

Signature · 1 line
2.17.2
author maintainer
#8 lore raw

PATCH v3 8/18 libmultipath: add vend_id to get_vpd_sgio

In reply to Benjamin Marzinski

This tells multipath how it should decode vendor specific pages. It will be used by a future patch.

---
 libmultipath/discovery.c |  4 ++--
 libmultipath/discovery.h |  2 +-
 libmultipath/propsel.c   |  2 +-
 tests/vpd.c              | 10 +++++-----
 4 files changed, 9 insertions(+), 9 deletions(-)
libmultipath/discovery.c +2 -2
index 19a8d2af..8b9bdb55 100644
@@ -1205,7 +1205,7 @@ get_vpd_sysfs (struct udev_device *parent, int pg, char * str, int maxlen)
 }
 
 int
-get_vpd_sgio (int fd, int pg, char * str, int maxlen)
+get_vpd_sgio (int fd, int pg, int vend_id, char * str, int maxlen)
 {
 	int len, buff_len;
 	unsigned char buff[4096];
@@ -1880,7 +1880,7 @@ static ssize_t uid_fallback(struct path *pp, int path_state,
 		if (len < 0 && path_state == PATH_UP) {
 			condlog(1, "%s: failed to get sysfs uid: %s",
 				pp->dev, strerror(-len));
-			len = get_vpd_sgio(pp->fd, 0x83, pp->wwid,
+			len = get_vpd_sgio(pp->fd, 0x83, 0, pp->wwid,
 					   WWID_SIZE);
 			*origin = "sgio";
 		}
libmultipath/discovery.h +1 -1
index 0516e41b..6444887d 100644
@@ -35,7 +35,7 @@ int path_get_tpgs(struct path *pp); /* This function never returns TPGS_UNDEF */
 int do_tur (char *);
 int path_offline (struct path *);
 int get_state (struct path * pp, struct config * conf, int daemon, int state);
-int get_vpd_sgio (int fd, int pg, char * str, int maxlen);
+int get_vpd_sgio (int fd, int pg, int vend_id, char * str, int maxlen);
 int pathinfo (struct path * pp, struct config * conf, int mask);
 int alloc_path_with_pathinfo (struct config *conf, struct udev_device *udevice,
 			      const char *wwid, int flag, struct path **pp_ptr);
libmultipath/propsel.c +1 -1
index a5fc6ba0..cd372d94 100644
@@ -504,7 +504,7 @@ check_rdac(struct path * pp)
 	if (__do_set_from_hwe(checker_name, pp, checker_name) &&
 	    strcmp(checker_name, RDAC))
 		return 0;
-	len = get_vpd_sgio(pp->fd, 0xC9, buff, 44);
+	len = get_vpd_sgio(pp->fd, 0xC9, 0, buff, 44);
 	if (len <= 0)
 		return 0;
 	return !(memcmp(buff + 4, "vac1", 4));
tests/vpd.c +5 -5
index 1e653ed4..0331c487 100644
@@ -429,7 +429,7 @@ static void test_vpd_vnd_ ## len ## _ ## wlen(void **state)             \
 	free(exp_wwid);							\
 	will_return(__wrap_ioctl, n);					\
 	will_return(__wrap_ioctl, vt->vpdbuf);				\
-	ret = get_vpd_sgio(10, 0x83, vt->wwid, wlen);			\
+	ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, wlen);		\
 	assert_correct_wwid("test_vpd_vnd_" #len "_" #wlen,		\
 			    exp_len, ret, '1', 0, false,		\
 			    exp_subst, vt->wwid);			\
@@ -459,7 +459,7 @@ static void test_vpd_str_ ## typ ## _ ## len ## _ ## wlen(void **state) \
 		exp_len = wlen - 1;					\
 	will_return(__wrap_ioctl, n);					\
 	will_return(__wrap_ioctl, vt->vpdbuf);				\
-	ret = get_vpd_sgio(10, 0x83, vt->wwid, wlen);			\
+	ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, wlen);		\
 	assert_correct_wwid("test_vpd_str_" #typ "_" #len "_" #wlen,	\
 			    exp_len, ret, byte0[type], 0,		\
 			    type != STR_IQN,				\
@@ -496,7 +496,7 @@ static void test_vpd_naa_ ## naa ## _ ## wlen(void **state)             \
 			 3, naa, 0);					\
 	will_return(__wrap_ioctl, n);					\
 	will_return(__wrap_ioctl, vt->vpdbuf);				\
-	ret = get_vpd_sgio(10, 0x83, vt->wwid, wlen);			\
+	ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, wlen);		\
 	assert_correct_wwid("test_vpd_naa_" #naa "_" #wlen,		\
 			    exp_len, ret, '3', '0' + naa, true,		\
 			    test_id, vt->wwid);				\
@@ -527,7 +527,7 @@ static void test_vpd_eui_ ## len ## _ ## wlen ## _ ## sml(void **state)	\
 	}								\
 	will_return(__wrap_ioctl, n);					\
 	will_return(__wrap_ioctl, vt->vpdbuf);				\
-	ret = get_vpd_sgio(10, 0x83, vt->wwid, wlen);			\
+	ret = get_vpd_sgio(10, 0x83, 0, vt->wwid, wlen);		\
 	assert_correct_wwid("test_vpd_eui_" #len "_" #wlen "_" #sml,	\
 			    exp_len, ret, '2', 0, true,			\
 			    test_id, vt->wwid);				\
@@ -554,7 +554,7 @@ static void test_vpd80_ ## size ## _ ## len ## _ ## wlen(void **state)  \
 			 size, len);					\
 	will_return(__wrap_ioctl, n);					\
 	will_return(__wrap_ioctl, vt->vpdbuf);				\
-	ret = get_vpd_sgio(10, 0x80, vt->wwid, wlen);			\
+	ret = get_vpd_sgio(10, 0x80, 0, vt->wwid, wlen);		\
 	assert_correct_wwid("test_vpd80_" #size "_" #len "_" #wlen,	\
 			    exp_len, ret, 0, 0, false,			\
 			    input, vt->wwid);				\
Signature · 1 line
2.17.2
author maintainer
#9 lore raw

PATCH v3 9/18 libmultipath: add code to get vendor specific vpd data

In reply to Benjamin Marzinski

This adds the wildcard 'g' for multipath and path formatted printing, which returns extra data from a device's vendor specific vpd page. The specific vendor vpd page to use, and the vendor/product id to decode it can be set in the hwentry with vpd_vendor_pg and vpd_vendor_id. It can be configured in the devices section of multipath.conf with the vpd_vendor parameter. Currently, the only devices that use this are HPE 3PAR arrays, to return the Volume Name.

---
 libmultipath/config.c      |  2 ++
 libmultipath/config.h      |  1 +
 libmultipath/dict.c        | 38 ++++++++++++++++++++++++++++++++++++
 libmultipath/discovery.c   | 40 +++++++++++++++++++++++++++++++++++++-
 libmultipath/hwtable.c     |  1 +
 libmultipath/print.c       | 25 ++++++++++++++++++++++++
 libmultipath/propsel.c     | 18 +++++++++++++++++
 libmultipath/propsel.h     |  1 +
 libmultipath/structs.h     | 15 ++++++++++++++
 multipath/multipath.conf.5 |  8 ++++++++
 10 files changed, 148 insertions(+), 1 deletion(-)
libmultipath/config.c +2 -0
index 366f4e30..b4d87689 100644
@@ -369,6 +369,7 @@ merge_hwe (struct hwentry * dst, struct hwentry * src)
 	merge_num(max_sectors_kb);
 	merge_num(ghost_delay);
 	merge_num(all_tg_pt);
+	merge_num(vpd_vendor_id);
 	merge_num(san_path_err_threshold);
 	merge_num(san_path_err_forget_rate);
 	merge_num(san_path_err_recovery_time);
@@ -517,6 +518,7 @@ store_hwe (vector hwtable, struct hwentry * dhwe)
 	hwe->detect_prio = dhwe->detect_prio;
 	hwe->detect_checker = dhwe->detect_checker;
 	hwe->ghost_delay = dhwe->ghost_delay;
+	hwe->vpd_vendor_id = dhwe->vpd_vendor_id;
 
 	if (dhwe->bl_product && !(hwe->bl_product = set_param_str(dhwe->bl_product)))
 		goto out;
libmultipath/config.h +1 -0
index 853febf2..ceecff2d 100644
@@ -87,6 +87,7 @@ struct hwentry {
 	int max_sectors_kb;
 	int ghost_delay;
 	int all_tg_pt;
+	int vpd_vendor_id;
 	char * bl_product;
 };
 
libmultipath/dict.c +38 -0
index e8a5ecb2..3e25e74f 100644
@@ -1408,6 +1408,43 @@ def_uxsock_timeout_handler(struct config *conf, vector strvec)
 	return 0;
 }
 
+static int
+hw_vpd_vendor_handler(struct config *conf, vector strvec)
+{
+	int i;
+	char *buff;
+
+	struct hwentry * hwe = VECTOR_LAST_SLOT(conf->hwtable);
+	if (!hwe)
+		return 1;
+
+	buff = set_value(strvec);
+	if (!buff)
+		return 1;
+	for (i = 0; i < VPD_VP_ARRAY_SIZE; i++) {
+		if (strcmp(buff, vpd_vendor_pages[i].name) == 0) {
+			hwe->vpd_vendor_id = i;
+			goto out;
+		}
+	}
+	hwe->vpd_vendor_id = 0;
+out:
+	FREE(buff);
+	return 0;
+}
+
+static int
+snprint_hw_vpd_vendor(struct config *conf, char * buff, int len,
+		      const void * data)
+{
+	const struct hwentry * hwe = (const struct hwentry *)data;
+
+	if (hwe->vpd_vendor_id > 0 && hwe->vpd_vendor_id < VPD_VP_ARRAY_SIZE)
+		return snprintf(buff, len, "%s",
+				vpd_vendor_pages[hwe->vpd_vendor_id].name);
+	return 0;
+}
+
 /*
  * blacklist block handlers
  */
@@ -1848,6 +1885,7 @@ init_keywords(vector keywords)
 	install_keyword("max_sectors_kb", &hw_max_sectors_kb_handler, &snprint_hw_max_sectors_kb);
 	install_keyword("ghost_delay", &hw_ghost_delay_handler, &snprint_hw_ghost_delay);
 	install_keyword("all_tg_pt", &hw_all_tg_pt_handler, &snprint_hw_all_tg_pt);
+	install_keyword("vpd_vendor", &hw_vpd_vendor_handler, &snprint_hw_vpd_vendor);
 	install_sublevel_end();
 
 	install_keyword_root("overrides", &overrides_handler);
libmultipath/discovery.c +39 -1
index 8b9bdb55..c1186c98 100644
@@ -34,6 +34,11 @@
 #include "prioritizers/alua_rtpg.h"
 #include "foreign.h"
 
+struct vpd_vendor_page vpd_vendor_pages[VPD_VP_ARRAY_SIZE] = {
+	[VPD_VP_UNDEF]	= { 0x00, "undef" },
+	[VPD_VP_HP3PAR]	= { 0xc0, "hp3par" },
+};
+
 int
 alloc_path_with_pathinfo (struct config *conf, struct udev_device *udevice,
 			  const char *wwid, int flag, struct path **pp_ptr)
@@ -1173,6 +1178,30 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len,
 	return len;
 }
 
+static int
+parse_vpd_c0_hp3par(const unsigned char *in, size_t in_len,
+		    char *out, size_t out_len)
+{
+	size_t len;
+
+	memset(out, 0x0, out_len);
+	if (in_len <= 4 || (in[4] > 3 && in_len < 44)) {
+		condlog(3, "HP/3PAR vendor specific VPD page length too short: %lu", in_len);
+		return -EINVAL;
+	}
+	if (in[4] <= 3) /* revision must be > 3 to have Vomlume Name */
+		return -ENODATA;
+	len = get_unaligned_be32(&in[40]);
+	if (len > out_len || len + 44 > in_len) {
+		condlog(3, "HP/3PAR vendor specific Volume name too long: %lu",
+			len);
+		return -EINVAL;
+	}
+	memcpy(out, &in[44], len);
+	out[out_len - 1] = '\0';
+	return len;
+}
+
 static int
 get_vpd_sysfs (struct udev_device *parent, int pg, char * str, int maxlen)
 {
@@ -1240,7 +1269,9 @@ get_vpd_sgio (int fd, int pg, int vend_id, char * str, int maxlen)
 			len = (buff_len <= maxlen)? buff_len : maxlen;
 			memcpy (str, buff, len);
 		}
-	} else
+	} else if (pg == 0xc0 && vend_id == VPD_VP_HP3PAR)
+		len = parse_vpd_c0_hp3par(buff, buff_len, str, maxlen);
+	else
 		len = -ENOSYS;
 
 	return len;
@@ -1610,10 +1641,17 @@ scsi_ioctl_pathinfo (struct path * pp, int mask)
 {
 	struct udev_device *parent;
 	const char *attr_path = NULL;
+	int vpd_id;
 
 	if (!(mask & DI_SERIAL))
 		return;
 
+	select_vpd_vendor_id(conf, pp);
+	vpd_id = pp->vpd_vendor_id;
+
+	if (vpd_id != VPD_VP_UNDEF && get_vpd_sgio(pp->fd, vpd_vendor_pages[vpd_id].pg, vpd_id, pp->vpd_data, sizeof(pp->vpd_data)) < 0)
+		condlog(3, "%s: failed to get extra vpd data", pp->dev);
+
 	parent = pp->udev;
 	while (parent) {
 		const char *subsys = udev_device_get_subsystem(parent);
libmultipath/hwtable.c +1 -0
index 16627ec5..dd6a17d4 100644
@@ -117,6 +117,7 @@ static struct hwentry default_hw[] = {
 		.no_path_retry = 18,
 		.fast_io_fail  = 10,
 		.dev_loss      = MAX_DEV_LOSS_TMO,
+		.vpd_vendor_id = VPD_VP_HP3PAR,
 	},
 	{
 		/* RA8000 / ESA12000 */
libmultipath/print.c +25 -0
index e1ef4d3f..1858d8ea 100644
@@ -360,6 +360,21 @@ snprint_action (char * buff, size_t len, const struct multipath * mpp)
 	}
 }
 
+static int
+snprint_multipath_vpd_data(char * buff, size_t len,
+			   const struct multipath * mpp)
+{
+	struct pathgroup * pgp;
+	struct path * pp;
+	int i, j;
+
+	vector_foreach_slot(mpp->pg, pgp, i)
+		vector_foreach_slot(pgp->paths, pp, j)
+			if (strlen(pp->vpd_data))
+				return snprintf(buff, len, "%s", pp->vpd_data);
+	return snprintf(buff, len, "[undef]");
+}
+
 /*
  * path info printing functions
  */
@@ -691,6 +706,14 @@ snprint_path_marginal(char * buff, size_t len, const struct path * pp)
 	return snprintf(buff, len, "normal");
 }
 
+static int
+snprint_path_vpd_data(char * buff, size_t len, const struct path * pp)
+{
+	if (strlen(pp->vpd_data) > 0)
+		return snprintf(buff, len, "%s", pp->vpd_data);
+	return snprintf(buff, len, "[undef]");
+}
+
 struct multipath_data mpd[] = {
 	{'n', "name",          0, snprint_name},
 	{'w', "uuid",          0, snprint_multipath_uuid},
@@ -715,6 +738,7 @@ struct multipath_data mpd[] = {
 	{'p', "prod",          0, snprint_multipath_prod},
 	{'e', "rev",           0, snprint_multipath_rev},
 	{'G', "foreign",       0, snprint_multipath_foreign},
+	{'g', "vpd page data", 0, snprint_multipath_vpd_data},
 	{0, NULL, 0 , NULL}
 };
 
@@ -740,6 +764,7 @@ struct path_data pd[] = {
 	{'r', "target WWPN",   0, snprint_tgt_wwpn},
 	{'a', "host adapter",  0, snprint_host_adapter},
 	{'G', "foreign",       0, snprint_path_foreign},
+	{'g', "vpd page data", 0, snprint_path_vpd_data},
 	{'0', "failures",      0, snprint_path_failures},
 	{'P', "protocol",      0, snprint_path_protocol},
 	{0, NULL, 0 , NULL}
libmultipath/propsel.c +18 -0
index cd372d94..8a2d9872 100644
@@ -1217,3 +1217,21 @@ out:
 		origin);
 	return 0;
 }
+
+int select_vpd_vendor_id (struct config *conf, struct path *pp)
+{
+	const char *origin;
+
+	pp_set_hwe(vpd_vendor_id);
+	pp_set_default(vpd_vendor_id, 0);
+out:
+	if (pp->vpd_vendor_id < 0 || pp->vpd_vendor_id >= VPD_VP_ARRAY_SIZE) {
+		condlog(3, "%s: vpd_vendor_id = %d (invalid, setting to 0)",
+			pp->dev, pp->vpd_vendor_id);
+		pp->vpd_vendor_id = 0;
+	}
+	condlog(3, "%s: vpd_vendor_id = %d \"%s\" %s", pp->dev,
+		pp->vpd_vendor_id, vpd_vendor_pages[pp->vpd_vendor_id].name,
+		origin);
+	return 0;
+}
libmultipath/propsel.h +1 -0
index ddfd6262..4fa08e1f 100644
@@ -37,3 +37,4 @@ void reconcile_features_with_options(const char *id, char **features,
 				     int* no_path_retry,
 				     int *retain_hwhandler);
 int select_all_tg_pt (struct config *conf, struct multipath * mp);
+int select_vpd_vendor_id (struct config *conf, struct path *pp);
libmultipath/structs.h +15 -0
index 250623af..b7a01220 100644
@@ -22,6 +22,7 @@
 #define HOST_NAME_LEN		16
 #define SLOT_NAME_SIZE		40
 #define PRKEY_SIZE		19
+#define VPD_DATA_SIZE		128
 
 #define SCSI_VENDOR_SIZE	9
 #define SCSI_PRODUCT_SIZE	17
@@ -222,6 +223,18 @@ enum all_tg_pt_states {
 	ALL_TG_PT_ON = YNU_YES,
 };
 
+enum vpd_vendor_ids {
+	VPD_VP_UNDEF,
+	VPD_VP_HP3PAR,
+	VPD_VP_ARRAY_SIZE, /* This must remain the last entry */
+};
+
+struct vpd_vendor_page {
+	int pg;
+	const char *name;
+};
+extern struct vpd_vendor_page vpd_vendor_pages[VPD_VP_ARRAY_SIZE];
+
 struct sg_id {
 	int host_no;
 	int channel;
@@ -256,6 +269,7 @@ struct path {
 	char rev[PATH_REV_SIZE];
 	char serial[SERIAL_SIZE];
 	char tgt_node_name[NODE_NAME_SIZE];
+	char vpd_data[VPD_DATA_SIZE];
 	unsigned long long size;
 	unsigned int checkint;
 	unsigned int tick;
@@ -288,6 +302,7 @@ struct path {
 	int io_err_pathfail_starttime;
 	int find_multipaths_timeout;
 	int marginal;
+	int vpd_vendor_id;
 	/* configlet pointers */
 	vector hwe;
 	struct gen_path generic_path;
multipath/multipath.conf.5 +8 -0
index e866da23..dc103fd8 100644
@@ -1472,6 +1472,14 @@ the \fIproduct\fR attribute set to the value of \fIproduct_blacklist\fR.
 The user_friendly_names prefix to use for this
 device type, instead of the default "mpath".
 .TP
+.B vpd_vendor
+The vendor specific vpd page information, using the vpd page abbreviation.
+The vpd page abbreviation can be found by running \fIsg_vpd -e\fR. multipathd
+will use this information to gather device specific information that can be
+displayed with the \fI%g\fR wilcard for the \fImultipathd show maps format\fR
+and \fImultipathd show paths format\fR commands. Currently only the
+\fBhp3par\fR vpd page is supported.
+.TP
 .B hardware_handler
 The hardware handler to use for this device type.
 The following hardware handler are implemented:
Signature · 1 line
2.17.2
author maintainer
#10 lore raw

PATCH v3 10/18 libmultipath: change how the checker async is set

In reply to Benjamin Marzinski

The way that the checkers async mode worked in multipathd didn't make much sense. When multipathd starts up, all checker classes are in the sync mode, and any pathinfo() calls on devices would run the checker in sync mode. However, the First time a checker class was used in checkerloop, it would set that checker class to async (assuming force_sync wasn't set). After that, no matter when a checker from that class was called, it would always run in async mode. Multipathd doesn't need to run checkers in sync mode at all, so don't.

---
 libmpathpersist/mpath_persist.c |  2 +-
 libmultipath/discovery.c        | 10 ++++------
 multipath/main.c                |  1 +
 3 files changed, 6 insertions(+), 7 deletions(-)
libmpathpersist/mpath_persist.c +1 -1
index 0c57dd92..3da7a6cf 100644
@@ -47,7 +47,7 @@ mpath_lib_init (void)
 		condlog(0, "Failed to initialize multipath config.");
 		return NULL;
 	}
-
+	conf->force_sync = 1;
 	set_max_fds(conf->max_fds);
 
 	return conf;
libmultipath/discovery.c +4 -6
index c1186c98..7bbd9fbe 100644
@@ -1719,12 +1719,10 @@ get_state (struct path * pp, struct config *conf, int daemon, int oldstate)
 	if (pp->mpp && !c->mpcontext)
 		checker_mp_init(c, &pp->mpp->mpcontext);
 	checker_clear_message(c);
-	if (daemon) {
-		if (conf->force_sync == 0)
-			checker_set_async(c);
-		else
-			checker_set_sync(c);
-	}
+	if (conf->force_sync == 0)
+		checker_set_async(c);
+	else
+		checker_set_sync(c);
 	if (!conf->checker_timeout &&
 	    sysfs_get_timeout(pp, &(c->timeout)) <= 0)
 		c->timeout = DEF_TIMEOUT;
multipath/main.c +1 -0
index c553437b..15007752 100644
@@ -906,6 +906,7 @@ main (int argc, char *argv[])
 		exit(RTVL_FAIL);
 	multipath_conf = conf;
 	conf->retrigger_tries = 0;
+	conf->force_sync = 1;
 	while ((arg = getopt(argc, argv, ":adcChl::FfM:v:p:b:BrR:itTquUwW")) != EOF ) {
 		switch(arg) {
 		case 1: printf("optarg : %s\n",optarg);
Signature · 1 line
2.17.2
author maintainer
#11 lore raw

PATCH v3 11/18 libmultipath: change failed path prio timeout

In reply to Benjamin Marzinski

multipath will try to get the priority from a PATH_DOWN path, if the path doesn't currently have a valid priority. However, if the priority code needs to contact the device to get the priority, this is likely to fail for PATH_DOWN paths. This code dates back to when multipathd could not easily reload device tables with failed paths, so getting the correct priority was important to have a correctly configured device. Now multipathd can simply reload the device to move the path to the correct pathgroup when the path comes back up. Since there are a number of prioritizers that don't require talking to the device, multipath shouldn't completely skip attempting to get the priority of these paths, but it should set a small timeout, so that it isn't hanging in the case where it needs to contact a device through a failed path.

---
 libmultipath/discovery.c | 14 ++++++--------
 libmultipath/prio.c      |  6 +++---
 2 files changed, 9 insertions(+), 11 deletions(-)
libmultipath/discovery.c +6 -8
index 7bbd9fbe..33a313a2 100644
@@ -1737,11 +1737,10 @@ get_state (struct path * pp, struct config *conf, int daemon, int oldstate)
 }
 
 static int
-get_prio (struct path * pp)
+get_prio (struct path * pp, int timeout)
 {
 	struct prio * p;
 	struct config *conf;
-	int checker_timeout;
 	int old_prio;
 
 	if (!pp)
@@ -1760,11 +1759,8 @@ get_prio (struct path * pp)
 			return 1;
 		}
 	}
-	conf = get_multipath_config();
-	checker_timeout = conf->checker_timeout;
-	put_multipath_config(conf);
 	old_prio = pp->priority;
-	pp->priority = prio_getprio(p, pp, checker_timeout);
+	pp->priority = prio_getprio(p, pp, timeout);
 	if (pp->priority < 0) {
 		/* this changes pp->offline, but why not */
 		int state = path_offline(pp);
@@ -2171,11 +2167,13 @@ int pathinfo(struct path *pp, struct config *conf, int mask)
 
 	 /*
 	  * Retrieve path priority, even for PATH_DOWN paths if it has never
-	  * been successfully obtained before.
+	  * been successfully obtained before. If path is down don't try
+	  * for too long.
 	  */
 	if ((mask & DI_PRIO) && path_state == PATH_UP && strlen(pp->wwid)) {
 		if (pp->state != PATH_DOWN || pp->priority == PRIO_UNDEF) {
-			get_prio(pp);
+			get_prio(pp, (pp->state != PATH_DOWN)?
+				     (conf->checker_timeout * 1000) : 10);
 		}
 	}
 
libmultipath/prio.c +3 -3
index 87de1f97..194563c4 100644
@@ -10,11 +10,11 @@
 
 static LIST_HEAD(prioritizers);
 
-unsigned int get_prio_timeout(unsigned int checker_timeout,
+unsigned int get_prio_timeout(unsigned int timeout_ms,
 			      unsigned int default_timeout)
 {
-	if (checker_timeout)
-		return checker_timeout * 1000;
+	if (timeout_ms)
+		return timeout_ms;
 	return default_timeout;
 }
 
Signature · 1 line
2.17.2
author maintainer
#12 lore raw

PATCH v3 12/18 multipathd: add new paths under vecs lock

In reply to Benjamin Marzinski

Right now, multipathd only ever calls pathinfo on a path outside of the vecs lock in one circumstance, when it's adding a new path from a uevent. Doing this can cause weirdness or crash multipathd.

First off, the path checker code is written assuming that only one checker instance will be active at a time. If this isn't the case, two processes can modify the checker's refcounts at the same time, potentially causing a checker to get removed while still in use (if two threads try to increment the refcount at the same time, causing it to only increment once).

Another issue is that since the vecs lock isn't grabbed until after all of the pathinfo is gathered, and the vecs lock is the only thing keeping the uevent servicing thread from running at the same time as a reconfigure is happening, it is possible to have multipathd add a path using the old config after reconfigure has already added that path using the new config. Leading to two versions of the path on the pathvec. There are possibly other issues with running pathinfo outside of the vecs lock that I haven't noticed, as well.

The easiest solution is to call pathinfo on the path while holding the vecs lock, to keep other threads from modifying the checker structure or the config while setting up the path. This is what happens every other time multipathd calls pathinfo, including when a path is added through the multipathd command interface.

This does mean that any time spent calling pathinfo on new paths will block other threads that need the vecs lock, but since the checker is now always called in async mode, and the prio function will use a short timeout if called on a failed path, this shouldn't be any more noticeable than the calls to check_path() for already existing paths.

---
 multipathd/main.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
multipathd/main.c +8 -8
index a590ba8d..e607acf3 100644
@@ -872,9 +872,8 @@ uev_add_path (struct uevent *uev, struct vectors * vecs, int need_do_map)
 			}
 		}
 	}
-	lock_cleanup_pop(vecs->lock);
 	if (pp)
-		return ret;
+		goto out;
 
 	/*
 	 * get path vital state
@@ -886,13 +885,13 @@ uev_add_path (struct uevent *uev, struct vectors * vecs, int need_do_map)
 	pthread_cleanup_pop(1);
 	if (!pp) {
 		if (ret == PATHINFO_SKIPPED)
-			return 0;
-		condlog(3, "%s: failed to get path info", uev->kernel);
-		return 1;
+			ret = 0;
+		else {
+			condlog(3, "%s: failed to get path info", uev->kernel);
+			ret = 1;
+		}
+		goto out;
 	}
-	pthread_cleanup_push(cleanup_lock, &vecs->lock);
-	lock(&vecs->lock);
-	pthread_testcancel();
 	ret = store_path(vecs->pathvec, pp);
 	if (!ret) {
 		conf = get_multipath_config();
@@ -906,6 +905,7 @@ uev_add_path (struct uevent *uev, struct vectors * vecs, int need_do_map)
 		free_path(pp);
 		ret = 1;
 	}
+out:
 	lock_cleanup_pop(vecs->lock);
 	return ret;
 }
Signature · 1 line
2.17.2
author maintainer
#13 lore raw

PATCH v3 13/18 libmultipath: add new checker class functions

In reply to Benjamin Marzinski

This commit adds the optional functions libcheck_load, libcheck_unload, and libcheck_reset. libcheck_load is called when a checker is first loaded, libcheck_unload is called when it is unloaded, and libcheck_reset is called during reconfigure, after all the current paths have been removed. They are designed to setup, reset, and destroy global state that all checkers of this class use. They will be used in future commits.

---
 libmultipath/checkers.c | 29 ++++++++++++++++++++++++++++-
 libmultipath/checkers.h |  1 +
 multipathd/main.c       |  1 +
 3 files changed, 30 insertions(+), 1 deletion(-)
libmultipath/checkers.c +28 -1
index a08bf418..5c7d3004 100644
@@ -18,6 +18,9 @@ struct checker_class {
 	int (*init)(struct checker *);       /* to allocate the context */
 	int (*mp_init)(struct checker *);    /* to allocate the mpcontext */
 	void (*free)(struct checker *);      /* to free the context */
+	int (*load)(void);                   /* to allocate global variables */
+	void (*unload)(void);                /* to free global variables */
+	int (*reset)(void);		     /* to reset the global variables */
 	const char **msgtable;
 	short msgtable_size;
 };
@@ -66,6 +69,8 @@ void free_checker_class(struct checker_class *c)
 	}
 	condlog(3, "unloading %s checker", c->name);
 	list_del(&c->node);
+	if (c->unload)
+		c->unload();
 	if (c->handle) {
 		if (dlclose(c->handle) != 0) {
 			condlog(0, "Cannot unload checker %s: %s",
@@ -98,6 +103,18 @@ static struct checker_class *checker_class_lookup(const char *name)
 	return NULL;
 }
 
+int reset_checker_classes(void)
+{
+	int ret = 0;
+	struct checker_class *c;
+
+	list_for_each_entry(c, &checkers, node) {
+		if (c->reset)
+			ret = ret? ret : c->reset();
+	}
+	return ret;
+}
+
 static struct checker_class *add_checker_class(const char *multipath_dir,
 					       const char *name)
 {
@@ -142,7 +159,11 @@ static struct checker_class *add_checker_class(const char *multipath_dir,
 		goto out;
 
 	c->mp_init = (int (*)(struct checker *)) dlsym(c->handle, "libcheck_mp_init");
-	/* NULL mp_init is o.k. call dlerror() to clear out any error string */
+	c->load = (int (*)(void)) dlsym(c->handle, "libcheck_load");
+	c->unload = (void (*)(void)) dlsym(c->handle, "libcheck_unload");
+	c->reset = (int (*)(void)) dlsym(c->handle, "libcheck_reset");
+	/* These 4 functions can be NULL. call dlerror() to clear out any
+	 * error string */
 	dlerror();
 
 	c->free = (void (*)(struct checker *)) dlsym(c->handle, "libcheck_free");
@@ -168,6 +189,12 @@ static struct checker_class *add_checker_class(const char *multipath_dir,
 	condlog(3, "checker %s: message table size = %d",
 		c->name, c->msgtable_size);
 
+	if (c->load && c->load() != 0) {
+		condlog(0, "%s: failed to load checker", c->name);
+		c->unload = NULL;
+		goto out;
+	}
+
 done:
 	c->sync = 1;
 	list_add(&c->node, &checkers);
libmultipath/checkers.h +1 -0
index 5237e7ec..d9930467 100644
@@ -150,6 +150,7 @@ void checker_disable (struct checker *);
 int checker_check (struct checker *, int);
 int checker_is_sync(const struct checker *);
 const char *checker_name (const struct checker *);
+int reset_checker_classes(void);
 /*
  * This returns a string that's best prepended with "$NAME checker",
  * where $NAME is the return value of checker_name().
multipathd/main.c +1 -0
index e607acf3..8baf9abe 100644
@@ -2575,6 +2575,7 @@ reconfigure (struct vectors * vecs)
 	vecs->pathvec = NULL;
 	delete_all_foreign();
 
+	reset_checker_classes();
 	/* Re-read any timezone changes */
 	tzset();
 
Signature · 1 line
2.17.2
author maintainer
#14 lore raw

PATCH v3 14/18 libmultipath: make directio checker share io contexts

In reply to Benjamin Marzinski

On systems with a large number of cores (>500), io_destroy() can take tens to hundreds of milliseconds to complete, due to RCU synchronization. If there are a large number of paths using the directio checker on such a system, this can lead to multipath taking almost a minute to complete, with the vast majority of time taken up by io_destroy().

To solve this, the directio checker now allocates one aio context for every 1024 checkers. This reduces the io_destroy() delay to a thousandth of its previous level. However, this means that muliple checkers are sharing the same aio context, and must be able to handle getting results for other checkers. Because only one checker is ever running at a time, this doesn't require any locking. However, locking could be added in the future if necessary, to allow multiple checkers to run at the same time.

When checkers are freed, they usually no longer destroy the io context. Instead, they attempt to cancel any outstanding request. If that fails, they put the request on an orphan list, so that it can be freed by other checkers, once it has completed. IO contexts are only destroyed at three times, during reconfigure (to deal with the possibility that multipathd is holding more aio events than it needs to be, since there is a single limit for the whole system), when the checker class is unloaded, and in a corner case when checkers are freed. If an aio_group (which contains the aio context) is entirely full of orphaned requests, then no checker can use it. Since no checker is using it, there is no checker to clear out the orphaned requests. In this (likely rare) case, the last checker from that group to be freed and leave behind an orphaned request will call io_destroy() and remove the group.

---
 libmultipath/checkers/directio.c | 336 +++++++++++++++++++++++++------
 multipath/multipath.conf.5       |   7 +-
 2 files changed, 281 insertions(+), 62 deletions(-)
libmultipath/checkers/directio.c +277 -59
index 239a811c..740c68e5 100644
@@ -17,6 +17,33 @@
 
 #include "checkers.h"
 #include "../libmultipath/debug.h"
+#include "../libmultipath/time-util.h"
+
+#define AIO_GROUP_SIZE 1024
+
+/* Note: This checker type relies on the fact that only one checker can be run
+ * at a time, since multiple checkers share the same aio_group, and must be
+ * able to modify other checker's async_reqs. If multple checkers become able
+ * to be run at the same time, this checker will need to add locking, and
+ * probably polling on event fds, to deal with that */
+
+struct aio_group {
+	struct list_head node;
+	int holders;
+	io_context_t ioctx;
+	struct list_head orphans;
+};
+
+struct async_req {
+	struct iocb io;
+	int blksize;
+	unsigned char *	buf;
+	unsigned char * ptr;
+	struct list_head node;
+	int state; /* PATH_REMOVED means this is an orphan */
+};
+
+static LIST_HEAD(aio_grp_list);
 
 enum {
 	MSG_DIRECTIO_UNKNOWN = CHECKER_FIRST_MSGID,
@@ -37,18 +64,136 @@ const char *libcheck_msgtable[] = {
 struct directio_context {
 	int		running;
 	int		reset_flags;
-	unsigned int	blksize;
-	unsigned char *	buf;
-	unsigned char * ptr;
-	io_context_t	ioctx;
-	struct iocb	io;
+	struct aio_group *aio_grp;
+	struct async_req *req;
 };
 
+static struct aio_group *
+add_aio_group(void)
+{
+	struct aio_group *aio_grp;
+
+	aio_grp = malloc(sizeof(struct aio_group));
+	if (!aio_grp)
+		return NULL;
+	memset(aio_grp, 0, sizeof(struct aio_group));
+	INIT_LIST_HEAD(&aio_grp->orphans);
+
+	if (io_setup(AIO_GROUP_SIZE, &aio_grp->ioctx) != 0) {
+		LOG(1, "io_setup failed");
+		if (errno == EAGAIN)
+			LOG(1, "global number of io events too small. Increase fs.aio-max-nr with sysctl");
+		free(aio_grp);
+		return NULL;
+	}
+	list_add(&aio_grp->node, &aio_grp_list);
+	return aio_grp;
+}
+
+static int
+set_aio_group(struct directio_context *ct)
+{
+	struct aio_group *aio_grp = NULL;
+
+	list_for_each_entry(aio_grp, &aio_grp_list, node)
+		if (aio_grp->holders < AIO_GROUP_SIZE)
+			goto found;
+	aio_grp = add_aio_group();
+	if (!aio_grp) {
+		ct->aio_grp = NULL;
+		return -1;
+	}
+found:
+	aio_grp->holders++;
+	ct->aio_grp = aio_grp;
+	return 0;
+}
+
+static void
+remove_aio_group(struct aio_group *aio_grp)
+{
+	struct async_req *req, *tmp;
+
+	io_destroy(aio_grp->ioctx);
+	list_for_each_entry_safe(req, tmp, &aio_grp->orphans, node) {
+		list_del(&req->node);
+		free(req->buf);
+		free(req);
+	}
+	list_del(&aio_grp->node);
+	free(aio_grp);
+}
+
+/* If an aio_group is completely full of orphans, then no checkers can
+ * use it, which means that no checkers can clear out the orphans. To
+ * avoid keeping the useless group around, simply remove remove the
+ * group */
+static void
+check_orphaned_group(struct aio_group *aio_grp)
+{
+	int count = 0;
+	struct list_head *item;
+
+	if (aio_grp->holders < AIO_GROUP_SIZE)
+		return;
+	list_for_each(item, &aio_grp->orphans)
+		count++;
+	if (count >= AIO_GROUP_SIZE) {
+		remove_aio_group(aio_grp);
+		if (list_empty(&aio_grp_list))
+			add_aio_group();
+	}
+}
+
+int libcheck_load (void)
+{
+	if (add_aio_group() == NULL) {
+		LOG(1, "libcheck_load failed: %s", strerror(errno));
+		return 1;
+	}
+	return 0;
+}
+
+void libcheck_unload (void)
+{
+	struct aio_group *aio_grp, *tmp;
+
+	list_for_each_entry_safe(aio_grp, tmp, &aio_grp_list, node)
+		remove_aio_group(aio_grp);
+}
+
+int libcheck_reset (void)
+{
+	struct aio_group *aio_grp, *tmp, *reset_grp = NULL;
+
+	/* If a clean existing aio_group exists, use that. Otherwise add a
+	 * new one */
+	list_for_each_entry(aio_grp, &aio_grp_list, node) {
+		if (aio_grp->holders == 0 &&
+		    list_empty(&aio_grp->orphans)) {
+			reset_grp = aio_grp;
+			break;
+		}
+	}
+	if (!reset_grp)
+		reset_grp = add_aio_group();
+	if (!reset_grp) {
+		LOG(1, "checker reset failed");
+		return 1;
+	}
+
+	list_for_each_entry_safe(aio_grp, tmp, &aio_grp_list, node) {
+		if (aio_grp != reset_grp)
+			remove_aio_group(aio_grp);
+	}
+	return 0;
+}
 
 int libcheck_init (struct checker * c)
 {
 	unsigned long pgsize = getpagesize();
 	struct directio_context * ct;
+	struct async_req *req = NULL;
 	long flags;
 
 	ct = malloc(sizeof(struct directio_context));
@@ -56,26 +201,31 @@ int libcheck_init (struct checker * c)
 		return 1;
 	memset(ct, 0, sizeof(struct directio_context));
 
-	if (io_setup(1, &ct->ioctx) != 0) {
-		condlog(1, "io_setup failed");
-		free(ct);
-		return 1;
+	if (set_aio_group(ct) < 0)
+		goto out;
+
+	req = malloc(sizeof(struct async_req));
+	if (!req) {
+		goto out;
 	}
+	memset(req, 0, sizeof(struct async_req));
+	INIT_LIST_HEAD(&req->node);
 
-	if (ioctl(c->fd, BLKBSZGET, &ct->blksize) < 0) {
+	if (ioctl(c->fd, BLKBSZGET, &req->blksize) < 0) {
 		c->msgid = MSG_DIRECTIO_BLOCKSIZE;
-		ct->blksize = 512;
+		req->blksize = 512;
 	}
-	if (ct->blksize > 4096) {
+	if (req->blksize > 4096) {
 		/*
 		 * Sanity check for DASD; BSZGET is broken
 		 */
-		ct->blksize = 4096;
+		req->blksize = 4096;
 	}
-	if (!ct->blksize)
+	if (!req->blksize)
 		goto out;
-	ct->buf = (unsigned char *)malloc(ct->blksize + pgsize);
-	if (!ct->buf)
+
+	req->buf = (unsigned char *)malloc(req->blksize + pgsize);
+	if (!req->buf)
 		goto out;
 
 	flags = fcntl(c->fd, F_GETFL);
@@ -88,17 +238,22 @@ int libcheck_init (struct checker * c)
 		ct->reset_flags = 1;
 	}
 
-	ct->ptr = (unsigned char *) (((unsigned long)ct->buf + pgsize - 1) &
+	req->ptr = (unsigned char *) (((unsigned long)req->buf + pgsize - 1) &
 		  (~(pgsize - 1)));
 
 	/* Successfully initialized, return the context. */
+	ct->req = req;
 	c->context = (void *) ct;
 	return 0;
 
 out:
-	if (ct->buf)
-		free(ct->buf);
-	io_destroy(ct->ioctx);
+	if (req) {
+		if (req->buf)
+			free(req->buf);
+		free(req);
+	}
+	if (ct->aio_grp)
+		ct->aio_grp->holders--;
 	free(ct);
 	return 1;
 }
@@ -106,6 +261,7 @@ out:
 void libcheck_free (struct checker * c)
 {
 	struct directio_context * ct = (struct directio_context *)c->context;
+	struct io_event event;
 	long flags;
 
 	if (!ct)
@@ -121,20 +277,72 @@ void libcheck_free (struct checker * c)
 		}
 	}
 
-	if (ct->buf)
-		free(ct->buf);
-	io_destroy(ct->ioctx);
+	if (ct->running &&
+	    (ct->req->state != PATH_PENDING ||
+	     io_cancel(ct->aio_grp->ioctx, &ct->req->io, &event) == 0))
+		ct->running = 0;
+	if (!ct->running) {
+		free(ct->req->buf);
+		free(ct->req);
+		ct->aio_grp->holders--;
+	} else {
+		ct->req->state = PATH_REMOVED;
+		list_add(&ct->req->node, &ct->aio_grp->orphans);
+		check_orphaned_group(ct->aio_grp);
+	}
+
 	free(ct);
+	c->context = NULL;
+}
+
+static int
+get_events(struct aio_group *aio_grp, struct timespec *timeout)
+{
+	struct io_event events[128];
+	int i, nr, got_events = 0;
+	struct timespec zero_timeout = {0};
+	struct timespec *timep = (timeout)? timeout : &zero_timeout;
+
+	do {
+		errno = 0;
+		nr = io_getevents(aio_grp->ioctx, 1, 128, events, timep);
+		got_events |= (nr > 0);
+
+		for (i = 0; i < nr; i++) {
+			struct async_req *req = container_of(events[i].obj, struct async_req, io);
+
+			LOG(3, "io finished %lu/%lu", events[i].res,
+			    events[i].res2);
+
+			/* got an orphaned request */
+			if (req->state == PATH_REMOVED) {
+				list_del(&req->node);
+				free(req->buf);
+				free(req);
+				aio_grp->holders--;
+			} else
+				req->state = (events[i].res == req->blksize) ?
+					      PATH_UP : PATH_DOWN;
+		}
+		timep = &zero_timeout;
+	} while (nr == 128); /* assume there are more events and try again */
+
+	if (nr < 0)
+		LOG(3, "async io getevents returned %i (errno=%s)",
+		    nr, strerror(errno));
+
+	return got_events;
 }
 
 static int
 check_state(int fd, struct directio_context *ct, int sync, int timeout_secs)
 {
 	struct timespec	timeout = { .tv_nsec = 5 };
-	struct io_event event;
 	struct stat	sb;
-	int		rc = PATH_UNCHECKED;
+	int		rc;
 	long		r;
+	struct timespec currtime, endtime;
+	struct timespec *timep = &timeout;
 
 	if (fstat(fd, &sb) == 0) {
 		LOG(4, "called for %x", (unsigned) sb.st_rdev);
@@ -145,50 +353,60 @@ check_state(int fd, struct directio_context *ct, int sync, int timeout_secs)
 		timeout.tv_nsec = 0;
 	}
 
-	if (!ct->running) {
-		struct iocb *ios[1] = { &ct->io };
+	if (ct->running) {
+		if (ct->req->state != PATH_PENDING) {
+			ct->running = 0;
+			return ct->req->state;
+		}
+	} else {
+		struct iocb *ios[1] = { &ct->req->io };
 
 		LOG(3, "starting new request");
-		memset(&ct->io, 0, sizeof(struct iocb));
-		io_prep_pread(&ct->io, fd, ct->ptr, ct->blksize, 0);
-		if (io_submit(ct->ioctx, 1, ios) != 1) {
+		memset(&ct->req->io, 0, sizeof(struct iocb));
+		io_prep_pread(&ct->req->io, fd, ct->req->ptr,
+			      ct->req->blksize, 0);
+		ct->req->state = PATH_PENDING;
+		if (io_submit(ct->aio_grp->ioctx, 1, ios) != 1) {
 			LOG(3, "io_submit error %i", errno);
 			return PATH_UNCHECKED;
 		}
 	}
 	ct->running++;
 
-	errno = 0;
-	r = io_getevents(ct->ioctx, 1L, 1L, &event, &timeout);
+	get_monotonic_time(&endtime);
+	endtime.tv_sec += timeout.tv_sec;
+	endtime.tv_nsec += timeout.tv_nsec;
+	normalize_timespec(&endtime);
+	while(1) {
+		r = get_events(ct->aio_grp, timep);
 
-	if (r < 0 ) {
-		LOG(3, "async io getevents returned %li (errno=%s)", r,
-		    strerror(errno));
-		ct->running = 0;
-		rc = PATH_UNCHECKED;
-	} else if (r < 1L) {
-		if (ct->running > timeout_secs || sync) {
-			struct iocb *ios[1] = { &ct->io };
-
-			LOG(3, "abort check on timeout");
-			r = io_cancel(ct->ioctx, ios[0], &event);
-			/*
-			 * Only reset ct->running if we really
-			 * could abort the pending I/O
-			 */
-			if (r)
-				LOG(3, "io_cancel error %i", errno);
-			else
-				ct->running = 0;
-			rc = PATH_DOWN;
-		} else {
-			LOG(3, "async io pending");
-			rc = PATH_PENDING;
-		}
+		if (ct->req->state != PATH_PENDING) {
+			ct->running = 0;
+			return ct->req->state;
+		} else if (r == 0 || !timep)
+			break;
+
+		get_monotonic_time(&currtime);
+		timespecsub(&endtime, &currtime, &timeout);
+		if (timeout.tv_sec < 0)
+			timep = NULL;
+	}
+	if (ct->running > timeout_secs || sync) {
+		struct io_event event;
+
+		LOG(3, "abort check on timeout");
+
+		r = io_cancel(ct->aio_grp->ioctx, &ct->req->io, &event);
+		/*
+		 * Only reset ct->running if we really
+		 * could abort the pending I/O
+		 */
+		if (!r)
+			ct->running = 0;
+		rc = PATH_DOWN;
 	} else {
-		LOG(3, "io finished %lu/%lu", event.res, event.res2);
-		ct->running = 0;
-		rc = (event.res == ct->blksize) ? PATH_UP : PATH_DOWN;
+		LOG(3, "async io pending");
+		rc = PATH_PENDING;
 	}
 
 	return rc;
multipath/multipath.conf.5 +4 -3
index dc103fd8..05a5e8ff 100644
@@ -494,9 +494,10 @@ Check the path state for LSI/Engenio/NetApp RDAC class as NetApp SANtricity E/EF
 Series, and OEM arrays from IBM DELL SGI STK and SUN.
 .TP
 .I directio
-(Deprecated) Read the first sector with direct I/O. This checker is being
-deprecated, it could cause spurious path failures under high load.
-Please use \fItur\fR instead.
+(Deprecated) Read the first sector with direct I/O. If you have a large number
+of paths, or many AIO users on a system, you may need to use sysctl to
+increase fs.aio-max-nr. This checker is being deprecated, it could cause
+spurious path failures under high load. Please use \fItur\fR instead.
 .TP
 .I cciss_tur
 (Hardware-dependent)
Signature · 1 line
2.17.2
author maintainer
#15 lore raw

PATCH v3 15/18 tests: add directio unit tests

In reply to Benjamin Marzinski
---
 tests/Makefile   |   3 +-
 tests/directio.c | 704 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 706 insertions(+), 1 deletion(-)
 create mode 100644 tests/directio.c
tests/Makefile +2 -1
index c9406e75..e9081e8f 100644
@@ -12,7 +12,8 @@ CFLAGS += $(BIN_CFLAGS) -I$(multipathdir) -I$(mpathcmddir) \
 	-Wno-unused-parameter $(W_MISSING_INITIALIZERS)
 LIBDEPS += -L$(multipathdir) -lmultipath -lcmocka
 
-TESTS := uevent parser util dmevents hwtable blacklist unaligned vpd pgpolicy alias
+TESTS := uevent parser util dmevents hwtable blacklist unaligned vpd pgpolicy \
+	 alias directio
 
 .SILENT: $(TESTS:%=%.o)
 .PRECIOUS: $(TESTS:%=%-test)
tests/directio.c new file +704 -0

704 lines not on this page · raw message

Signature · 1 line
2.17.2
author maintainer
#16 lore raw

PATCH v3 16/18 fixup! libmultipath: add code to get vendor specific vpd data

In reply to Benjamin Marzinski

From: Martin Wilck <[email protected]>

---
 libmultipath/discovery.c | 2 +-
 libmultipath/propsel.c   | 2 +-
 libmultipath/propsel.h   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
libmultipath/discovery.c +1 -1
index 33a313a2..23a7889c 100644
@@ -1646,7 +1646,7 @@ scsi_ioctl_pathinfo (struct path * pp, int mask)
 	if (!(mask & DI_SERIAL))
 		return;
 
-	select_vpd_vendor_id(conf, pp);
+	select_vpd_vendor_id(pp);
 	vpd_id = pp->vpd_vendor_id;
 
 	if (vpd_id != VPD_VP_UNDEF && get_vpd_sgio(pp->fd, vpd_vendor_pages[vpd_id].pg, vpd_id, pp->vpd_data, sizeof(pp->vpd_data)) < 0)
libmultipath/propsel.c +1 -1
index 8a2d9872..897e48ca 100644
@@ -1218,7 +1218,7 @@ out:
 	return 0;
 }
 
-int select_vpd_vendor_id (struct config *conf, struct path *pp)
+int select_vpd_vendor_id (struct path *pp)
 {
 	const char *origin;
 
libmultipath/propsel.h +1 -1
index 4fa08e1f..3d6edd8a 100644
@@ -37,4 +37,4 @@ void reconcile_features_with_options(const char *id, char **features,
 				     int* no_path_retry,
 				     int *retain_hwhandler);
 int select_all_tg_pt (struct config *conf, struct multipath * mp);
-int select_vpd_vendor_id (struct config *conf, struct path *pp);
+int select_vpd_vendor_id (struct path *pp);
Signature · 1 line
2.17.2
author maintainer
#17 lore raw

PATCH v3 17/18 fixup! libmultipath: make directio checker share io contexts

In reply to Benjamin Marzinski

From: Martin Wilck <[email protected]>

---
 libmultipath/checkers/directio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libmultipath/checkers/directio.c +1 -1
index 740c68e5..813e61e2 100644
@@ -36,7 +36,7 @@ struct aio_group {
 
 struct async_req {
 	struct iocb io;
-	int blksize;
+	unsigned int blksize;
 	unsigned char *	buf;
 	unsigned char * ptr;
 	struct list_head node;
Signature · 1 line
2.17.2
author maintainer
#18 lore raw

PATCH v3 18/18 tests: make directio tests able to work on a real device

In reply to Benjamin Marzinski

There is now a file in tests called directio_test_dev. If the commented out test device line is uncommented and set to a device, it can be used to test the directio checker on that device, instead of faking the device.

---
 tests/Makefile          |  16 +++++-
 tests/directio.c        | 114 ++++++++++++++++++++++++++++++++++++++--
 tests/directio_test_dev |   4 ++
 3 files changed, 130 insertions(+), 4 deletions(-)
 create mode 100644 tests/directio_test_dev
tests/Makefile +15 -1
index e9081e8f..6e3e9ca2 100644
@@ -18,10 +18,18 @@ TESTS := uevent parser util dmevents hwtable blacklist unaligned vpd pgpolicy \
 .SILENT: $(TESTS:%=%.o)
 .PRECIOUS: $(TESTS:%=%-test)
 
+DIO_TEST_DEV = $(shell sed -n -e 's/^[[:space:]]*DIO_TEST_DEV[[:space:]]*=[[:space:]]*\([^[:space:]\#]\+\).*/\1/p' < directio_test_dev)
+
 all:	$(TESTS:%=%.out)
 
+# test-specific compiler flags
+# XYZ-test_FLAGS: Additional compiler flags for this test
+ifneq ($(DIO_TEST_DEV),)
+directio-test_FLAGS := -DDIO_TEST_DEV=\"$(DIO_TEST_DEV)\"
+endif
+
 # test-specific linker flags
-# XYZ-test-TESTDEPS: test libraries containing __wrap_xyz functions
+# XYZ-test_TESTDEPS: test libraries containing __wrap_xyz functions
 # XYZ-test_OBJDEPS: object files from libraries to link in explicitly
 #    That may be necessary if functions called from the object file are wrapped
 #    (wrapping works only for symbols which are undefined after processing a
@@ -40,6 +48,12 @@ vpd-test_OBJDEPS :=  ../libmultipath/discovery.o
 vpd-test_LIBDEPS := -ludev -lpthread -ldl
 alias-test_TESTDEPS := test-log.o
 alias-test_LIBDEPS := -lpthread -ldl
+ifneq ($(DIO_TEST_DEV),)
+directio-test_LIBDEPS := -laio
+endif
+
+%.o: %.c
+	$(CC) $(CFLAGS) $($*-test_FLAGS) -c -o $@ $<
 
 lib/libchecktur.so:
 	mkdir lib
tests/directio.c +111 -3

243 lines not on this page · raw message

tests/directio_test_dev new file +4 -0
new file mode 100644
index 00000000..d64e6238
@@ -0,0 +1,4 @@
+# To run the directio tests on an actual block device, uncomment the line
+# starting with DIO_TES_DEV, and set it to the appropriate device
+
+# DIO_TEST_DEV=/dev/sdb
Signature · 1 line
2.17.2
#19 lore raw
In reply to Benjamin Marzinski
Quoted 119 lines · Benjamin Marzinski

This patch set is has multiple parts.

patch 01 is just a resubmit of my previous patch, with Martin's corrections added.

Patches 02 - 06 are miscellaneous fixes and cleanups

Patches 07 - 09 are related to adding a new format wildcard, at the
request of HPE, that allows multipath to get and display information from the vendor specific VPD pages

Patches 10 - 18 are the part that needs the most review, patch 14
especially. It turns out that on machines with a large number of cores, io_destroy(), which is used by the directio checker, can take a long time to complete. Talking to some kernel people at Red Hat, I was told that this isn't a bug. It's working as expected, and multipath shouldn't be issuing so many io_destroy() calls (1 per path, when multipath or multipathd stops). Cutting out the io_destroy calls involved a major
change
to the directio checker. It's pretty hard to test a lot of the corner cases on actual hardware, so I've written a bunch of unit tests for this (patches 16 & 17).

Changes in v3:
This removes the conflicts with Martin's earlier patches, specifically

0003-libmultipath-fix-leak-in-foreign-code.patch
removed in favor of Martin's
"libmultipath: _init_foreign(): fix possible memory leak" patch

0016-fixup-libmultipath-add-code-to-get-vendor-specific-v.patch 0017-fixup-libmultipath-make-directio-checker-share-io-co.patch
New patches to fix compile-time errors resulting from the rebase

0018-tests-make-directio-tests-able-to-work-on-a-real-dev.patch
Fix conflicts between with Martin's earlier patches

Changes in v2:
0001-multipathd-warn-when-configuration-has-been-changed.patch
Changed to reflect Martin Wilck's comments

0002-multipathd-staticify-uxlsnr-variables-functions.patch
New patch

0008-libmultipath-fix-sgio_get_vpd-looping.patch
Test has been changed to keep create_vpd83 the same, and overwrite the length in the actual test, as suggested by Martin Wilck

0010-libmultipath-add-code-to-get-vendor-specific-vpd-dat.patch

	The information to find the vpd page and how to decode it is
	now simply the index in a table of name -> page_nr mappings

0012-libmultipath-change-failed-path-prio-timeout.patch
The timeout argument has been renamed to avoid confusion, as suggested by Martin Wilck

0015-libmultipath-make-directio-checker-share-io-contexts.patch
Minor changes to print more useful messages, and avoid printing anything when we get a non-zero io_cancel() result, as suggested by Martin Wilck

0016-tests-add-directio-unit-tests.patch
Minor change to improve readability, as suggested by Martin Wilck

0017-tests-make-directio-tests-able-to-work-on-a-real-dev.patch
New patch. This adds the ability to set a testing device, so you can run the directio tests on an actual device

Benjamin Marzinski (16):
multipathd: warn when configuration has been changed.
multipathd: staticify uxlsnr variables/functions Fix leak in mpathpersist
libmultipath: remove unused path->prio_args
libmultipath: constify get_unaligned_be*
libmultipath: add missing hwe mpe variable merges
libmultipath: fix sgio_get_vpd looping
libmultipath: add vend_id to get_vpd_sgio
libmultipath: add code to get vendor specific vpd data
libmultipath: change how the checker async is set
libmultipath: change failed path prio timeout
multipathd: add new paths under vecs lock
libmultipath: add new checker class functions
libmultipath: make directio checker share io contexts
tests: add directio unit tests
tests: make directio tests able to work on a real device

Martin Wilck (2):
fixup! libmultipath: add code to get vendor specific vpd data fixup! libmultipath: make directio checker share io contexts

 libmpathpersist/mpath_persist.c  |   2 +-
 libmultipath/checkers.c          |  29 +-
 libmultipath/checkers.h          |   1 +
 libmultipath/checkers/directio.c | 336 ++++++++++---
 libmultipath/config.c            |  10 +
 libmultipath/config.h            |   2 +
 libmultipath/dict.c              |  38 ++
 libmultipath/discovery.c         |  80 ++-
 libmultipath/discovery.h         |   2 +-
 libmultipath/hwtable.c           |   1 +
 libmultipath/print.c             |  25 +
 libmultipath/prio.c              |   6 +-
 libmultipath/propsel.c           |  20 +-
 libmultipath/propsel.h           |   1 +
 libmultipath/structs.h           |  16 +-
 libmultipath/unaligned.h         |   4 +-
 mpathpersist/main.c              |   1 +
 multipath/main.c                 |   1 +
 multipath/multipath.conf.5       |  15 +-
 multipathd/main.c                |  18 +-
 multipathd/uxlsnr.c              | 150 +++++-
Quoted 9 lines
 tests/Makefile                   |  19 +-
 tests/directio.c                 | 812
+++++++++++++++++++++++++++++++
 tests/directio_test_dev          |   4 +
 tests/vpd.c                      |  87 ++--
 25 files changed, 1527 insertions(+), 153 deletions(-)
 create mode 100644 tests/directio.c
 create mode 100644 tests/directio_test_dev

ACK for the series.

... one small nit: I'd rather not add the new file "tests/directio_test_dev" from patch 18/18 to version control (git), because the file is likely to be different in every environment, and changes to the file will need to be stashed away before every branch export, which is inconvenient. "make test" will work just fine without the file. I'd prefer a tests/README file explaining how to activate directio-on-real-device testing.

But this is not a reject, Christophe could fix this when merging, or I'll post a fix.

Martin

Signature · 4 lines
Dr. Martin Wilck <[email protected]>, Tel. +49 (0)911 74053 2107
SUSE  Software Solutions Germany GmbH
HRB 36809, AG Nürnberg GF: Felix
Imendörffer