Re: [dm-devel] [PATCH] multipathd: use nanosleep for sleeping

2018-03-06 Thread Martin Wilck
On Mon, 2018-03-05 at 19:20 -0600, Benjamin Marzinski wrote: > In order to safely use SIGALRM in a multi-threaded program, only one > thread can schedule and wait on SIGALRM at a time. All other threads > must have SIGALRM blocked, and be unable to schedule an alarm. The > strict_timing code in

[dm-devel] [PATCH v2 2/2] multipathd: start marginal path checker thread lazily

2018-03-06 Thread Martin Wilck
I noticed that the io_error checker thread accounts for most of the activity of multipathd even if the marginal path checking paramters are not set (which is still the default in most installations I assume). Therefore, start the io_error checker thread only if there's at least one map with

[dm-devel] [PATCH] multipathd: fix -Wpointer-to-int-cast warning in uxlsnr

2018-03-06 Thread Martin Wilck
Fixes: "multipathd: release uxsocket and resource when cancel thread" Signed-off-by: Martin Wilck --- multipathd/uxlsnr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multipathd/uxlsnr.c b/multipathd/uxlsnr.c index 0531061912b3..cdafd82943e7 100644 ---

Re: [dm-devel] [PATCH 0/6] Fixes for config file parsing

2018-03-06 Thread Martin Wilck
Just in case this is getting confusing, I've collected the latest versions of my submissions, and what I gathered from others since 0.7.4, here (currently 83 commits ahead of last upstream commit): https://github.com/openSUSE/multipath-tools/tree/upstream-queue Please notify me if I missed

Re: [dm-devel] dm-bufio: avoid false-positive Wmaybe-uninitialized warning

2018-03-06 Thread Mike Snitzer
On Tue, Mar 06 2018 at 4:33pm -0500, Arnd Bergmann wrote: > On Thu, Feb 22, 2018 at 5:04 PM, Mike Snitzer wrote: > > On Thu, Feb 22 2018 at 10:56am -0500, > > Arnd Bergmann wrote: > > > > > Mikulas already sent a fix for this: > >

Re: [dm-devel] dm-bufio: avoid false-positive Wmaybe-uninitialized warning

2018-03-06 Thread Arnd Bergmann
On Thu, Feb 22, 2018 at 5:04 PM, Mike Snitzer wrote: > On Thu, Feb 22 2018 at 10:56am -0500, > Arnd Bergmann wrote: > > Mikulas already sent a fix for this: > https://patchwork.kernel.org/patch/10211631/ > > But I like yours a bit better, though I'll likely

[dm-devel] [PATCH 1/6] tests/uevent: fix -Wcast-qual errors

2018-03-06 Thread Martin Wilck
I overlooked these in my previous series of fixes. Fixes: "libmultipath: fix compiler warnings for -Wcast-qual" Signed-off-by: Martin Wilck --- tests/uevent.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/uevent.c b/tests/uevent.c index

[dm-devel] [PATCH 0/6] Fixes for config file parsing

2018-03-06 Thread Martin Wilck
This series was motivated by the real-world problem that a user couldn't figure out how to write a blacklist entry for a device called '1.8" SSD'. Fixing this for good turned out to be a little tricky, therefore I also added a test suite. Martin Wilck (6): tests/uevent: fix -Wcast-qual errors

[dm-devel] [PATCH 3/6] libmultipath: config parser: don't strip whitepace between quotes

2018-03-06 Thread Martin Wilck
Between double quotes, the parser currently strips leading (but not trailing) whitespace. That's inconsistent and unexpected. Fix it. Signed-off-by: Martin Wilck --- libmultipath/parser.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[dm-devel] [PATCH 2/6] tests: add unit tests for config file parser

2018-03-06 Thread Martin Wilck
Add test cases for parsing the config file. Some of these tests currently fail unless the CPP macros at the top are set to 1. The patches that follow fix them. Signed-off-by: Martin Wilck --- tests/Makefile | 2 +- tests/globals.c | 1 + tests/parser.c | 497

[dm-devel] [PATCH 6/6] multipath.conf(5): improve syntax documentation

2018-03-06 Thread Martin Wilck
Describe the syntax of attribute / value pairs, comments, and quoted strings, as well as the peculiarities of section beginnings and ends. Also describe the newly added '""' feature. Signed-off-by: Martin Wilck --- multipath/multipath.conf.5 | 17 + 1 file

[dm-devel] [PATCH 3/4] libmultipath: uev_update_path: always warn if WWID changed

2018-03-06 Thread Martin Wilck
Print the warning about changed WWID not only if disable_changed_wwids is set, but always. It's actually more dangerous if that option is not set. Signed-off-by: Martin Wilck --- multipathd/main.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-)

[dm-devel] [PATCH 5/6] libmultipath: config parser: fix corner case for double quotes

2018-03-06 Thread Martin Wilck
A corner case of the previous patch are strings starting with a double quote, such as '"prepended to itself is false" prepended to itself is false' or '"" is the empty string', and in particular, the string '"' ("\"" in C notation), which is indistinguishable from the "QUOTE" token in the parsed

[dm-devel] [PATCH 4/6] libmultipath: config parser: Allow '"' in strings

2018-03-06 Thread Martin Wilck
We have seen model strings lile '2.5" SSD' which can't be parsed by the current config parser. This patch fixes this by allowing '""' to represent a double quote character inside a a string. The above model string could now be entered in the config file like this: blacklist { vendor

[dm-devel] [PATCH 0/4] fixes for path wwid detection and path change uevents

2018-03-06 Thread Martin Wilck
Hi Christophe, this small series fixes some minor glitches I found in the current path discovery code, and attempts to implement the safe part of the functionality discussed in the thread "multipathd: update path's udev in uev_update_path" in January (based on an idea from Wu Chongyun). Martin

[dm-devel] [PATCH 1/4] libmultipath: get_uid: check VPD pages for SCSI only

2018-03-06 Thread Martin Wilck
The VPD code won't work for non-SCSI devices, anyway. For indentation reasons, I moved the "retrigger_tries" case to a separate function, which is also called only for SCSI devices. Signed-off-by: Martin Wilck --- libmultipath/discovery.c | 50

[dm-devel] [PATCH 2/4] libmultipath: get_uid: don't quit prematurely without udev

2018-03-06 Thread Martin Wilck
Not all the implemented methods to derive the UID rely on udev information being present. For example getuid callout, rbd, and the SCSI vpd code work fine without it. It's unlikely that we don't get udev data, but we want to be as good as possible at deriving the uid. Signed-off-by: Martin Wilck

[dm-devel] [PATCH 4/4] libmultipath: uev_update_path: update path properties

2018-03-06 Thread Martin Wilck
Update pp->udev and those path attributes that can be cheaply updated from sysfs, i.e. without IO to the disk. Signed-off-by: Martin Wilck --- multipathd/main.c | 8 1 file changed, 8 insertions(+) diff --git a/multipathd/main.c b/multipathd/main.c index

Re: [dm-devel] [PATCH v2 1/2] libmultipath: fix race in stop_io_err_stat_thread

2018-03-06 Thread Hannes Reinecke
On 03/06/2018 10:18 PM, Martin Wilck wrote: > It's wrong, and unnecessary, to call pthread_kill after > pthread_cancel. I have observed cases where the io_err checker > thread hung in libpthread after receiving the USR2 signal, in particular > when multipathd is run under strace. (If multipathd is

Re: [dm-devel] [PATCH 0/6] Various multipath-tools patches

2018-03-06 Thread Benjamin Marzinski
On Thu, Mar 01, 2018 at 11:29:29AM -0800, Bart Van Assche wrote: > Hello Christophe, > > This series contains the following patches: > - Four patches address Coverity complaints. > - One patch makes a function argument const. > - One patch addresses a bug that I discovered while inspecting the

Re: [dm-devel] [PATCH] multipathd: fix inverted signal blocking logic

2018-03-06 Thread Martin Wilck
On Mon, 2018-03-05 at 18:46 -0600, Benjamin Marzinski wrote: > > This is prety close to what I had in mind. The only things missing, > that > I noticed when I was looking at multipathd's signal handling, is > dealing > with SIGUSR2 in io_err_stat.c, which it sounds like you have already >

[dm-devel] confusion about multipath_prepare_ioctl

2018-03-06 Thread Wang Sheng-Hui
Dear, Sorry to trouble you. I noticed some code in dm-*.c like: " static int multipath_prepare_ioctl(struct dm_target *ti, struct block_device **bdev, fmode_t *mode) { ... /* * Only pass ioctls through if the device sizes match exactly. */ if (!r

Re: [dm-devel] [PATCH v2 23/23] multipathd: fix signal blocking logic

2018-03-06 Thread Martin Wilck
On Tue, 2018-03-06 at 08:16 +0100, Hannes Reinecke wrote: > On 03/06/2018 12:15 AM, Martin Wilck wrote: > > multipathd is supposed to block all signals in all threads, except > > the uxlsnr thread which handles termination and reconfiguration > > signals (SIGUSR1) in its ppoll() call, SIGUSR2 in