Re: [dm-devel] [RFC PATCH 1/1] dm: add dust target

2019-01-08 Thread Damien Le Moal
On 2019/01/09 4:53, Bryan Gurney wrote: > On Tue, Jan 8, 2019 at 11:23 AM Mike Snitzer wrote: >> >> On Tue, Jan 08 2019 at 10:30am -0500, >> Bryan Gurney wrote: >> >>> On Mon, Jan 7, 2019 at 7:10 PM Benjamin Marzinski >>> wrote: On Mon, Jan 07, 2019 at 02:31:23PM -0500, Bryan Gurney

[dm-devel] [PATCH] multipathd: avoid crash in cli_list_path

2019-01-08 Thread Martin Wilck
multipathd can be crashed by passing an invalid path name to the "show path" command. Fix it. --- multipathd/cli_handlers.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c index 6304ed3a..fabf4440 100644 --- a/multipathd/cli_handlers.c

[dm-devel] [PATCH 04/12] libmultipath(coverity): make sure readlink result is 0-terminated

2019-01-08 Thread Martin Wilck
Coverity warned that readlink() results aren't necessarily 0-terminated. Signed-off-by: Martin Wilck --- libmultipath/util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libmultipath/util.c b/libmultipath/util.c index 944c632..5b838d5 100644 --- a/libmultipath/util.c +++

[dm-devel] [PATCH 08/12] libmultipath(coverity): fix "enum misuse" for find_multipaths

2019-01-08 Thread Martin Wilck
Signed-off-by: Martin Wilck --- libmultipath/dict.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmultipath/dict.c b/libmultipath/dict.c index fd29abc..eaad4f1 100644 --- a/libmultipath/dict.c +++ b/libmultipath/dict.c @@ -327,7 +327,7 @@

[dm-devel] [PATCH 02/12] libmultipath(coverity): cleanup dup usage in execute_program()

2019-01-08 Thread Martin Wilck
coverity complained about resource leakage here. Signed-off-by: Martin Wilck --- libmultipath/callout.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libmultipath/callout.c b/libmultipath/callout.c index d5ca27b..dac088c 100644 --- a/libmultipath/callout.c

[dm-devel] [PATCH 05/12] libmultipath(coverity): fix apparent overflow

2019-01-08 Thread Martin Wilck
"preferred_path" contains always "0" or "1". Signed-off-by: Martin Wilck --- libmultipath/discovery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index 7f983a6..3fd79a3 100644 --- a/libmultipath/discovery.c +++

[dm-devel] [PATCH 10/12] libmpathpersist(coverity): range checking for PRIN length

2019-01-08 Thread Martin Wilck
Signed-off-by: Martin Wilck --- libmpathpersist/mpath_pr_ioctl.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libmpathpersist/mpath_pr_ioctl.c b/libmpathpersist/mpath_pr_ioctl.c index c4f4ccd..cf528fe 100644 --- a/libmpathpersist/mpath_pr_ioctl.c +++

[dm-devel] [PATCH 12/12] libmultipath(coverity): fix possible NULL dereference

2019-01-08 Thread Martin Wilck
coverity warns that recv_packet may set reply to NULL. Signed-off-by: Martin Wilck --- libmultipath/configure.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmultipath/configure.c b/libmultipath/configure.c index 64a1f7b..970b913 100644 --- a/libmultipath/configure.c

[dm-devel] [PATCH 09/12] multipathd(coverity): check retval clock_gettime()

2019-01-08 Thread Martin Wilck
Checking this is pointless, as we'd bail out early in pthread_cond_init_mono if CLOCK_MONOTONIC was unsupported, and this is the only error condition of clock_gettime worth checking. Do it anyway to make coverity feel better. Signed-off-by: Martin Wilck --- multipathd/main.c | 9 + 1

[dm-devel] [PATCH 07/12] libmultipath(coverity): fix int overflow in sysfs_set_scsi_tmo

2019-01-08 Thread Martin Wilck
Signed-off-by: Martin Wilck --- libmultipath/discovery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index 3fd79a3..1748eeb 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -711,7 +711,7 @@

[dm-devel] [PATCH 06/12] libmpathcmd(coverity): limit reply length

2019-01-08 Thread Martin Wilck
coverity warned about tainted input data. Signed-off-by: Martin Wilck --- libmpathcmd/mpath_cmd.c | 4 libmpathcmd/mpath_cmd.h | 6 ++ multipathd/cli.c | 2 ++ multipathd/cli.h | 6 ++ multipathd/cli_handlers.c | 1 + 5 files changed, 19 insertions(+) diff

[dm-devel] [PATCH 11/12] libmultipath/foreign(coverity): retval check in snprint_nvme_path

2019-01-08 Thread Martin Wilck
Signed-off-by: Martin Wilck --- libmultipath/foreign/nvme.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libmultipath/foreign/nvme.c b/libmultipath/foreign/nvme.c index f0e8293..7e654ec 100644 --- a/libmultipath/foreign/nvme.c +++ b/libmultipath/foreign/nvme.c @@

[dm-devel] [PATCH 01/12] kpartx(coverity): fix resource leak warning

2019-01-08 Thread Martin Wilck
This was an easy-to-fix false positive. Signed-off-by: Martin Wilck --- kpartx/dasd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kpartx/dasd.c b/kpartx/dasd.c index 94ae81b..fb358ad 100644 --- a/kpartx/dasd.c +++ b/kpartx/dasd.c @@ -137,7 +137,7 @@ read_dasd_pt(int

[dm-devel] [PATCH 03/12] kpartx(coverity): fix apparent out-of-bounds access

2019-01-08 Thread Martin Wilck
This was a false positive. Signed-off-by: Martin Wilck --- kpartx/dasd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kpartx/dasd.c b/kpartx/dasd.c index fb358ad..61b609a 100644 --- a/kpartx/dasd.c +++ b/kpartx/dasd.c @@ -190,7 +190,7 @@ read_dasd_pt(int fd, struct slice

[dm-devel] [PATCH 00/12] multipath-tools: Coverity patches

2019-01-08 Thread Martin Wilck
Hi Christophe, here are a few simple fixes motivated by a recent coverity scan of the latest upstream. Most are false positives, but it can't hurt to fix them anyway, be it only to get a quicker overview on future scans. Unfortunately synopsys messed up the scan.coverity.com website before I

Re: [dm-devel] [RFC PATCH 1/1] dm: add dust target

2019-01-08 Thread Mike Snitzer
On Tue, Jan 08 2019 at 2:52pm -0500, Bryan Gurney wrote: > On Tue, Jan 8, 2019 at 11:23 AM Mike Snitzer wrote: > > > > I'm fine with it as is, but I have a different concern: why does this > > target need to override the queue_limits at all? What is the benefit to > > rigidly imposing the

Re: [dm-devel] [RFC PATCH 1/1] dm: add dust target

2019-01-08 Thread Bryan Gurney
On Tue, Jan 8, 2019 at 11:23 AM Mike Snitzer wrote: > > On Tue, Jan 08 2019 at 10:30am -0500, > Bryan Gurney wrote: > > > On Mon, Jan 7, 2019 at 7:10 PM Benjamin Marzinski > > wrote: > > > > > > On Mon, Jan 07, 2019 at 02:31:23PM -0500, Bryan Gurney wrote: > > > > + > > > > +static int

Re: [dm-devel] [RFC PATCH 1/1] dm: add dust target

2019-01-08 Thread Benjamin Marzinski
On Tue, Jan 08, 2019 at 10:30:32AM -0500, Bryan Gurney wrote: > On Mon, Jan 7, 2019 at 7:10 PM Benjamin Marzinski wrote: > > > > On Mon, Jan 07, 2019 at 02:31:23PM -0500, Bryan Gurney wrote: > > > + > > > +static int dust_add_block(struct dust_device *dd, unsigned long long > > > block) > > > +{

Re: [dm-devel] [PATCH 00/19] san_path_err & multipath ANA support

2019-01-08 Thread Benjamin Marzinski
On Tue, Jan 08, 2019 at 09:50:33AM +0100, Martin Wilck wrote: > On Mon, 2019-01-07 at 13:15 -0600, Benjamin Marzinski wrote: > > On Mon, Jan 07, 2019 at 12:21:55PM +0100, Martin Wilck wrote: > > > On Fri, 2018-12-21 at 10:06 -0600, Benjamin Marzinski wrote: > > > > I've been thinking about how we

Re: [dm-devel] [RFC PATCH 1/1] dm: add dust target

2019-01-08 Thread Mike Snitzer
On Tue, Jan 08 2019 at 10:30am -0500, Bryan Gurney wrote: > On Mon, Jan 7, 2019 at 7:10 PM Benjamin Marzinski wrote: > > > > On Mon, Jan 07, 2019 at 02:31:23PM -0500, Bryan Gurney wrote: > > > + > > > +static int dust_map_read(struct dust_device *dd, sector_t thisblock, > > > +

Re: [dm-devel] [RFC PATCH 1/1] dm: add dust target

2019-01-08 Thread Bryan Gurney
On Mon, Jan 7, 2019 at 7:10 PM Benjamin Marzinski wrote: > > On Mon, Jan 07, 2019 at 02:31:23PM -0500, Bryan Gurney wrote: > > Add the dm-dust target, which simulates the behavior of bad sectors > > at arbitrary locations, and the ability to enable the emulation of > > the read failures at an

[dm-devel] [PATCH 1/3] libmultipath: fix compilation with older kernel headers

2019-01-08 Thread Martin Wilck
Compilation fails if the kernel headers don't provide "linux/nvme_ioctl.h". Fix that by shipping the kernel header file from nvme-cli. Fixes: 17c71c79e276 "libmultipath: add wrapper library for nvme ioctls" Signed-off-by: Martin Wilck --- Makefile.inc | 1 +

[dm-devel] [PATCH 2/3] multipath: fix gcc 4.8 uninitialized variable warning

2019-01-08 Thread Martin Wilck
gcc 4.8 complained about "err" not being initialized. Fix, and simplify. Signed-off-by: Martin Wilck --- multipath/main.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/multipath/main.c b/multipath/main.c index a25e1b4f..5abb1181 100644 --- a/multipath/main.c +++

[dm-devel] [PATCH 0/3] multipath-tools: compilation fixes

2019-01-08 Thread Martin Wilck
Hi Christophe, my late NVMe patch series broke compilatioin with older kernel headers. This series fixes that, and adds two other minor build-related fixes. Regards, Martin Martin Wilck (3): libmultipath: fix compilation with older kernel headers multipath: fix gcc 4.8 uninitialized

[dm-devel] [PATCH 3/3] multipath_tools: remove ENABLE_RADOS

2019-01-08 Thread Martin Wilck
This is pointless since we removed RBD support altogether. Signed-off-by: Martin Wilck --- Makefile.inc | 3 --- 1 file changed, 3 deletions(-) diff --git a/Makefile.inc b/Makefile.inc index 23154fed..fc728ca9 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -9,9 +9,6 @@ # WITH_LOCAL_LIBDM

Re: [dm-devel] [PATCH 1/1] libmultipath: dm_is_mpath cleanup

2019-01-08 Thread Martin Wilck
Hi Christophe, you missed the patch below in your last merge. Thanks, Martin On Tue, 2018-12-11 at 15:23 -0600, Benjamin Marzinski wrote: > Add condlog() message in dm_is_mpath() fails and change the > dm_is_mpath() call in watch_dmevents() to check the return value with > the same syntax as

Re: [dm-devel] [PATCH 00/19] san_path_err & multipath ANA support

2019-01-08 Thread Martin Wilck
On Mon, 2019-01-07 at 13:15 -0600, Benjamin Marzinski wrote: > On Mon, Jan 07, 2019 at 12:21:55PM +0100, Martin Wilck wrote: > > On Fri, 2018-12-21 at 10:06 -0600, Benjamin Marzinski wrote: > > > I've been thinking about how we handle marginal paths, and it > > > seems > > > to > > > me that