Re: [dm-devel] [PATCH v4 03/19] libmultipath: fix tur memory misuse

2018-10-10 Thread Martin Wilck
On Tue, 2018-10-09 at 18:03 -0500, Benjamin Marzinski wrote: > when tur_thread() was calling tur_check(), it was passing ct->message > as > the copy argument, but copy_msg_to_tcc() was assuming that it was > getting a tur_checker_context pointer. This means it was treating > ct->message as ct.

Re: [dm-devel] [PATCH v4 01/19] libmultipath: fix tur checker timeout

2018-10-10 Thread Martin Wilck
On Tue, 2018-10-09 at 18:02 -0500, Benjamin Marzinski wrote: > The code previously was timing out mode if ct->thread was 0 but > ct->running wasn't. This combination never happens. The idea was to > timeout if for some reason the path checker tried to cancel the > thread, > but it didn't die.

[dm-devel] dm_cache BUG() after power loss

2018-10-10 Thread Steinar H. Gunderson
Hi, We had a power loss event, and when a server with dm-cache came up again, it paniced (see below for the panic text). I couldn't find any other way to remedy this than to blow away the metadata volume, which I assumed was safe as the cache is in writethrough mode (after several catastrophic

Re: [dm-devel] [PATCH v4 00/19] Misc Multipath patches

2018-10-10 Thread Martin Wilck
On Tue, 2018-10-09 at 18:02 -0500, Benjamin Marzinski wrote: > This batch is a resend of v4, rebased on the latest upstream code > with > changes base on Martin's review > > Changes in v4 > 0001-libmultipath-fix-tur-checker-timeout.patch now fails back > to synchronous mode if the

Re: [dm-devel] [PATCH v4 00/19] Misc Multipath patches

2018-10-10 Thread Martin Wilck
On Wed, 2018-10-10 at 09:19 +0200, Martin Wilck wrote: > On Tue, 2018-10-09 at 18:02 -0500, Benjamin Marzinski wrote: > > This batch is a resend of v4, rebased on the latest upstream code > > with > > changes base on Martin's review > > > > Changes in v4 > >

Re: [dm-devel] [PATCH v4 02/19] libmultipath: fix tur checker double locking

2018-10-10 Thread Martin Wilck
On Tue, 2018-10-09 at 18:02 -0500, Benjamin Marzinski wrote: > tur_devt() locks ct->lock. However, it is ocassionally called while > ct->lock is already locked. In reality, there is no reason why we > need > to lock all the accesses to ct->devt. The tur checker only needs to > write to this

[dm-devel] [PATCH] dm flakey: Document "error_writes" feature

2018-10-10 Thread Nikolay Borisov
Commit ef548c551e72 ("dm flakey: introduce "error_writes" feature") added the ability to dm flakey to error out writes in contrast to silently dropping it with 'drop_writes'. Unfortunately this feature is not currently documented and one has to be either familiar with the source code of dm flakey

Re: [dm-devel] [PATCH 11/11] block: Introduce revalidate_disk_zones()

2018-10-10 Thread Christoph Hellwig
> +static inline unsigned long *__alloc_zone_bitmap(int node, > + unsigned int nr_zones) > +{ > + return kcalloc_node(BITS_TO_LONGS(nr_zones), sizeof(unsigned long), > + GFP_NOIO | __GFP_ZERO, node); kcalloc already implies

Re: [dm-devel] [PATCH 01/11] scsi: sd_zbc: Rearrange code

2018-10-10 Thread Christoph Hellwig
On Wed, Oct 10, 2018 at 10:52:29AM +0900, Damien Le Moal wrote: > Move the urswrz check out of sd_zbc_read_zones() and into > sd_zbc_read_zoned_characteristics() where that value is obtained (read > from the disk zoned characteristics VPD page). Since this function now > does more than simply

Re: [dm-devel] [PATCH 09/11] block: Expose queue nr_zones in sysfs

2018-10-10 Thread kbuild test robot
Hi Damien, Thank you for the patch! Yet something to improve: [auto build test ERROR on block/for-next] [also build test ERROR on v4.19-rc7 next-20181010] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci

Re: [dm-devel] [PATCH] dm flakey: Document "error_writes" feature

2018-10-10 Thread John Pittman
Hi Nikolay, I sent this one to Mike at the end of September.("dm flakey: add error_writes to documentation - "https://www.redhat.com/archives/dm-devel/2018-September/msg00146.html). Unsure if he has picked it up or not. Best Regards, John Pittman Customer Engagement and Experience Red Hat Inc.

Re: [dm-devel] [PATCH 03/11] scsi: sd_zbc: Fix sd_zbc_check_zones() error checks

2018-10-10 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 02/11] scsi: sd_zbc: Reduce boot device scan and revalidate time

2018-10-10 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 04/11] block: Introduce blkdev_nr_zones() helper

2018-10-10 Thread Christoph Hellwig
On Wed, Oct 10, 2018 at 10:52:32AM +0900, Damien Le Moal wrote: > Introduce the blkdev_nr_zones() helper function to get the total > number of zones of a zoned block device. This number is always 0 for a > regular block device (q->limits.zoned == BLK_ZONED_NONE case). > > Replace hard-coded

Re: [dm-devel] [PATCH 05/11] block: Limit allocation of zone descriptors for report zones

2018-10-10 Thread Christoph Hellwig
> + unsigned int nr_zones; > int ret; > > if (!argp) > @@ -355,8 +356,9 @@ int blkdev_report_zones_ioctl(struct block_device *bdev, > fmode_t mode, > if (!rep.nr_zones) > return -EINVAL; > > - if (rep.nr_zones > INT_MAX / sizeof(struct blk_zone)) > -

Re: [dm-devel] [PATCH 07/11] block: Introduce BLKGETNRZONES ioctl

2018-10-10 Thread Christoph Hellwig
On Wed, Oct 10, 2018 at 10:52:35AM +0900, Damien Le Moal wrote: > Get a zoned block device total number of zones. The device can be a > partition of the whole device. The number of zones is always 0 for > regular block devices. Looks good, Reviewed-by: Christoph Hellwig -- dm-devel mailing

Re: [dm-devel] [PATCH 06/11] block: Introduce BLKGETZONESZ ioctl

2018-10-10 Thread Christoph Hellwig
On Wed, Oct 10, 2018 at 10:52:34AM +0900, Damien Le Moal wrote: > Get a zoned block device zone size in number of 512 B sectors. > The zone size is always 0 for regular block devices. Looks good, Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com

Re: [dm-devel] [PATCH 08/11] block: Improve zone reset execution

2018-10-10 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 10/11] block: add a report_zones method

2018-10-10 Thread kbuild test robot
Hi Christoph, I love your patch! Yet something to improve: [auto build test ERROR on block/for-next] [also build test ERROR on v4.19-rc7] [cannot apply to next-20181010] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https

Re: [dm-devel] [PATCH 10/11] block: add a report_zones method

2018-10-10 Thread kbuild test robot
Hi Christoph, I love your patch! Yet something to improve: [auto build test ERROR on block/for-next] [also build test ERROR on v4.19-rc7] [cannot apply to next-20181010] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https

Re: [dm-devel] [PATCH 2/6] multipathd: check for NULL udevice in cli_add_path

2018-10-10 Thread Martin Wilck
On Wed, 2018-10-10 at 13:01 -0500, Benjamin Marzinski wrote: > If cli_add_path can't get a udevice for the path, it should fail > immediately, instead of continuing with a NULL udevice, since it will > fail in store_pathinfo() anyway. > > Signed-off-by: Benjamin Marzinski Reviewed-by: Martin

Re: [dm-devel] [PATCH 1/6] multipath: tweak logging style

2018-10-10 Thread Martin Wilck
On Wed, 2018-10-10 at 13:01 -0500, Benjamin Marzinski wrote: > When multipathd commands are run, errors should be printed to stderr, > instead of syslog. Also, when the multipath is run and calls > device-mapper, device-mapper should log to stderr instead of stdout, > just like multipath does now.

[dm-devel] [git pull] device mapper fixes for 4.19 final

2018-10-10 Thread Mike Snitzer
Hi Greg, The following changes since commit 0238df646e6224016a45505d2c111a24669ebe21: Linux 4.19-rc7 (2018-10-07 17:26:02 +0200) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git tags/for-4.19/dm-fixes-3 for you to fetch

[dm-devel] [PATCH 5/6] mpathpersist: fix registration rollback issue

2018-10-10 Thread Benjamin Marzinski
When mpathpersist tries to rollback the registration, it copies the SARK to the RK, and clears the SARK. However, it repeated this step for each thread. This means that the first rollback thread correctly had the RK set to the SARK used during registration. However, if more than one registration

[dm-devel] [PATCH 1/6] multipath: tweak logging style

2018-10-10 Thread Benjamin Marzinski
When multipathd commands are run, errors should be printed to stderr, instead of syslog. Also, when the multipath is run and calls device-mapper, device-mapper should log to stderr instead of stdout, just like multipath does now. Signed-off-by: Benjamin Marzinski --- libmultipath/devmapper.c |

[dm-devel] [PATCH 2/6] multipathd: check for NULL udevice in cli_add_path

2018-10-10 Thread Benjamin Marzinski
If cli_add_path can't get a udevice for the path, it should fail immediately, instead of continuing with a NULL udevice, since it will fail in store_pathinfo() anyway. Signed-off-by: Benjamin Marzinski --- multipathd/cli_handlers.c | 4 1 file changed, 4 insertions(+) diff --git

[dm-devel] [PATCH 4/6] multipathd: set return code for multipathd commands

2018-10-10 Thread Benjamin Marzinski
Failed multipathd commands should set the return code to 1. Signed-off-by: Benjamin Marzinski --- multipathd/main.c | 8 multipathd/uxclnt.c | 13 - 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/multipathd/main.c b/multipathd/main.c index

[dm-devel] [PATCH 0/6] More Misc Multipath patches

2018-10-10 Thread Benjamin Marzinski
Here are the patches that I've built up while getting my last batch accepted, as well as a change for the tur checker to hopefully address Martin's short term objections to commit 455242d (libmultipath: fix tur checker timeout). Benjamin Marzinski (6): multipath: tweak logging style

[dm-devel] [PATCH 6/6] libmultipath: timeout on unresponsive tur thread

2018-10-10 Thread Benjamin Marzinski
If the tur checker thread has been cancelled but isn't responding, timeout instead of doing a sync check. This will keep one bad device from impacting all of multipathd. Fixes: 455242d ("libmultipath: fix tur checker timeout") Cc: Martin Wilck Signed-off-by: Benjamin Marzinski ---

Re: [dm-devel] [PATCH 06/11] block: Introduce BLKGETZONESZ ioctl

2018-10-10 Thread Bart Van Assche
On Wed, 2018-10-10 at 10:52 +0900, Damien Le Moal wrote: > #define BLKREPORTZONE_IOWR(0x12, 130, struct blk_zone_report) > #define BLKRESETZONE _IOW(0x12, 131, struct blk_zone_range) > +#define BLKGETZONESZ _IOW(0x12, 132, unsigned int) >From Documentation/ioctl/botching-up-ioctls.txt,

Re: [dm-devel] [PATCH 6/6] libmultipath: timeout on unresponsive tur thread

2018-10-10 Thread Martin Wilck
On Wed, 2018-10-10 at 13:01 -0500, Benjamin Marzinski wrote: > If the tur checker thread has been cancelled but isn't responding, > timeout instead of doing a sync check. This will keep one bad > device from impacting all of multipathd. > > Fixes: 455242d ("libmultipath: fix tur checker

Re: [dm-devel] [PATCH 10/11] block: add a report_zones method

2018-10-10 Thread Mike Snitzer
On Tue, Oct 09 2018 at 9:52pm -0400, Damien Le Moal wrote: > From: Christoph Hellwig > > Dispatching a report zones command through the request queue is a major > pain due to the command reply payload rewriting necessary. Given that > blkdev_report_zones() is executing everything

Re: [dm-devel] [PATCH 10/11] block: add a report_zones method

2018-10-10 Thread Mike Snitzer
On Wed, Oct 10 2018 at 10:15am -0400, Mike Snitzer wrote: > On Tue, Oct 09 2018 at 9:52pm -0400, > Damien Le Moal wrote: > > > From: Christoph Hellwig > > > > Dispatching a report zones command through the request queue is a major > > pain due to the command reply payload rewriting

Re: [dm-devel] [PATCH 4/6] multipathd: set return code for multipathd commands

2018-10-10 Thread Martin Wilck
On Wed, 2018-10-10 at 13:01 -0500, Benjamin Marzinski wrote: > Failed multipathd commands should set the return code to 1. > > Signed-off-by: Benjamin Marzinski > --- Reviewed-by: Martin Wilck -- Dr. Martin Wilck , Tel. +49 (0)911 74053 2107 SUSE Linux GmbH, GF: Felix Imendörffer, Jane

Re: [dm-devel] [PATCH 3/6] libmultipath: remove max_fds code duplication

2018-10-10 Thread Martin Wilck
On Wed, 2018-10-10 at 13:01 -0500, Benjamin Marzinski wrote: > Instead of multipath, multipathd, and mpathpersist all having code to > set the max number of open file descriptors, just use a util function > to > do it. > > Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck -- Dr.

Re: [dm-devel] [PATCH 5/6] mpathpersist: fix registration rollback issue

2018-10-10 Thread Martin Wilck
On Wed, 2018-10-10 at 13:01 -0500, Benjamin Marzinski wrote: > When mpathpersist tries to rollback the registration, it copies > the SARK to the RK, and clears the SARK. However, it repeated this > step > for each thread. This means that the first rollback thread correctly > had the RK set to the

[dm-devel] [git pull] device mapper fix for 4.19 final

2018-10-10 Thread Mike Snitzer
On Wed, Oct 10 2018 at 4:35P -0400, Greg Kroah-Hartman wrote: > On Wed, Oct 10, 2018 at 12:46:44PM -0400, Mike Snitzer wrote: > > Hi Greg, > > > > The following changes since commit 0238df646e6224016a45505d2c111a24669ebe21: > > > > Linux 4.19-rc7 (2018-10-07 17:26:02 +0200) > > > > are

Re: [dm-devel] [git pull] device mapper fix for 4.19 final

2018-10-10 Thread Greg Kroah-Hartman
On Wed, Oct 10, 2018 at 11:37:11PM -0400, Mike Snitzer wrote: > On Wed, Oct 10 2018 at 4:35P -0400, > Greg Kroah-Hartman wrote: > > > On Wed, Oct 10, 2018 at 12:46:44PM -0400, Mike Snitzer wrote: > > > Hi Greg, > > > > > > The following changes since commit > > >

[dm-devel] [PATCH] multipath-tools: delete trailing whitespaces

2018-10-10 Thread Xose Vazquez Perez
Cc: Christophe Varoqui Cc: DM-DEV ML Signed-off-by: Xose Vazquez Perez --- libmultipath/checkers/tur.c | 2 +- tests/dmevents.c| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libmultipath/checkers/tur.c b/libmultipath/checkers/tur.c index 86c0cdc..5aeec6f

[dm-devel] [PATCH 6/8] libmultipath: test code for "zombie" TUR threads

2018-10-10 Thread Martin Wilck
This patch adds test code that simulates hanging, non-cancellable TUR threads, for testing multipathd's behavior in that situation. Compile libmultipath with CFLAGS=-DTUR_TEST_MAJOR=8 to activate the test code. Without that flag, the patch has no effect. Signed-off-by: Martin Wilck ---

[dm-devel] [PATCH 8/8] multipathd: handle repeated udev retrigger failure

2018-10-10 Thread Martin Wilck
If a path was still not properly initialized after exhausting the retrigger tries, it used to remain in INIT_MISSING_UDEV state forever. get_uid() might fall back to non-udev-based methods to determine the WWID, but it would never be called for a path in this state any more. This patch changes

[dm-devel] [PATCH 2/8] libmultipath: scsi_ioctl_pathinfo doesn't fail

2018-10-10 Thread Martin Wilck
This function never returns error, so make a void. Move the mask test to pathinfo() where it belongs. The error message about the serial number isn't important any more, reduce its level to v3. Signed-off-by: Martin Wilck --- libmultipath/discovery.c | 17 - 1 file changed, 8

Re: [dm-devel] [PATCH 5/6] mpathpersist: fix registration rollback issue

2018-10-10 Thread Martin Wilck
On Wed, 2018-10-10 at 20:12 +0200, Martin Wilck wrote: > > diff --git a/libmpathpersist/mpath_persist.c > > b/libmpathpersist/mpath_persist.c > > index 29e7fb4..2ffe56e 100644 > > --- a/libmpathpersist/mpath_persist.c > > +++ b/libmpathpersist/mpath_persist.c > > @@ -559,11 +559,10 @@ int

Re: [dm-devel] [PATCH 09/11] block: Expose queue nr_zones in sysfs

2018-10-10 Thread kbuild test robot
Hi Damien, Thank you for the patch! Yet something to improve: [auto build test ERROR on block/for-next] [also build test ERROR on v4.19-rc7 next-20181010] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci

Re: [dm-devel] [git pull] device mapper fixes for 4.19 final

2018-10-10 Thread Greg Kroah-Hartman
On Wed, Oct 10, 2018 at 12:46:44PM -0400, Mike Snitzer wrote: > Hi Greg, > > The following changes since commit 0238df646e6224016a45505d2c111a24669ebe21: > > Linux 4.19-rc7 (2018-10-07 17:26:02 +0200) > > are available in the Git repository at: > >

[dm-devel] [PATCH 4/8] multipath.rules: add comment about DM_MULTIPATH_DEVICE_PATH=2

2018-10-10 Thread Martin Wilck
See dm-devel discussion "Changes in DM_MULTIPATH_DEVICE_PATH in multipath-tools 0.7.7" (Sep. 2018) for rationale. Cc: Adam Williamson Signed-off-by: Martin Wilck --- multipath/multipath.rules | 4 1 file changed, 4 insertions(+) diff --git a/multipath/multipath.rules

[dm-devel] [PATCH 1/8] test-kpartx: add test for invocation on image file

2018-10-10 Thread Martin Wilck
Add a test for kpartx invocation on an image file that is not yet part of a loop device, passing a relative path to kpartx: # kpartx -av disk.img ... # kpartx -d disk.img The recent patches 95c4189b "kpartx: Use absolute paths to create mappings" and c1adcc5b "kpartx: Use

[dm-devel] [PATCH 5/8] multipath.8: man page update

2018-10-10 Thread Martin Wilck
Clean up the synopsis, listing only combinations of command line switches that work and make sense. Split the switches between "operation modes" and options. Fix the documentation of the -v switch, which was wrong. Move the description of the "device" argument to the top. Link to multipath.conf(5)

[dm-devel] [PATCH 7/8] libmultipath: handle TUR threads that can't be cancelled

2018-10-10 Thread Martin Wilck
When the tur checker code determines that a hanging TUR thread couldn't be cancelled, rather than simply returning, reallocate the checker context and start a new thread. This will leak some memory if the hanging thread never wakes up again, but well, in that highly unlikely case we're leaking

[dm-devel] [PATCH 3/8] libmultipath: cciss_ioctl_pathinfo doesn't fail

2018-10-10 Thread Martin Wilck
Make it a void function and move the DI_SERIAL test to pathinfo(). Signed-off-by: Martin Wilck --- libmultipath/discovery.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index 8381d982..873035e5 100644

[dm-devel] [PATCH 0/8] various multipath-tools patches

2018-10-10 Thread Martin Wilck
Hi Christophe, this series contains some patches I had on my list for some time, plus some stuff that came up during the discussion about Ben's last large patch series. This goes on top of the "[PATCH 0/6] More misc multipath patches" series that Ben sent today. Regards, Martin Martin Wilck

[dm-devel] [PATCH] dm linear: Fix linear_end_io conditional definition

2018-10-10 Thread Damien Le Moal
The dm-linear target is independent of the dm-zoned target. For code requiring support for zoned block devices, use CONFIG_BLK_DEV_ZONED instead of CONFIG_DM_ZONED. While at it, similarly to dm linear, also enable the DM_TARGET_ZONED_HM feature in dm-flakey only if CONFIG_BLK_DEV_ZONED is