Re: [dm-devel] V4.16+ kernel warning when running xfs/006

2018-04-04 Thread Dave Chinner
On Thu, Apr 05, 2018 at 07:12:52AM +0800, Ming Lei wrote: > Hi, > > The following warning is triggered when running xfs/006 with > v4.16+(the latest linus tree): > > > [ 4406.277765] run fstests xfs/006 at 2018-04-04 19:18:32 > [ 4408.437679] XFS (dm-0): Mounting V5 Filesystem > [ 4408.457115]

[dm-devel] V4.16+ kernel warning when running xfs/006

2018-04-04 Thread Ming Lei
Hi, The following warning is triggered when running xfs/006 with v4.16+(the latest linus tree): [ 4406.277765] run fstests xfs/006 at 2018-04-04 19:18:32 [ 4408.437679] XFS (dm-0): Mounting V5 Filesystem [ 4408.457115] XFS (dm-0): Ending clean mount [ 4430.340609] [ cut here

[dm-devel] [PATCH 1/4] multipathd: decrease log level of "spurious uevent" message

2018-04-04 Thread Martin Wilck
We trigger such events under various conditions, there's no point logging them at -v2. Signed-off-by: Martin Wilck --- multipathd/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multipathd/main.c b/multipathd/main.c index 7eeb743..7886c76 100644 ---

[dm-devel] [PATCH 4/4] libmpathpersist: decrease log level of various messages

2018-04-04 Thread Martin Wilck
Silence a few libmpathpersist messages which need not be printed at the default loglevel. Signed-off-by: Martin Wilck --- libmpathpersist/mpath_persist.c | 2 +- libmpathpersist/mpath_pr_ioctl.c | 32 2 files changed, 17 insertions(+), 17

[dm-devel] [PATCH 3/4] multipathd: decrease log level of waiter thread start/stop msgs

2018-04-04 Thread Martin Wilck
These rather unimportant messages account for a large portion of multipathd's log messages with the default verbosity level (2). Signed-off-by: Martin Wilck --- multipathd/waiter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multipathd/waiter.c

[dm-devel] [PATCH 2/4] libmultipath: decrease log level of uevent filter/merge messages

2018-04-04 Thread Martin Wilck
There should be no need to log these at -v2. The messages are informational. Signed-off-by: Martin Wilck --- libmultipath/uevent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmultipath/uevent.c b/libmultipath/uevent.c index 3955c49..fd8ca35 100644

[dm-devel] [PATCH v4 16/20] multipath -u : set FIND_MULTIPATHS_WAIT_UNTIL from /dev/shm

2018-04-04 Thread Martin Wilck
In "find_multipaths smart" mode, use time stamps under /dev/shm/multipath/find_multipaths to track waiting for multipath siblings. When a path is first encountered and is "maybe" multipath, create a file under /dev/shm, set its modification time to the expiry time of the timer, and set the

[dm-devel] [PATCH v4 18/20] multipath -u: quick check if path is multipathed

2018-04-04 Thread Martin Wilck
With "find_multipaths smart", we accept paths as valid if they are already part of a multipath map. This patch avoids doing a full path and device-mapper map scan for this case, speeding up "multipath -u" considerably. Signed-off-by: Martin Wilck --- libmultipath/sysfs.c | 66

[dm-devel] [PATCH v4 07/20] libmultipath: change find_multipaths option to multi-value

2018-04-04 Thread Martin Wilck
Change the "find_multipaths" option from yes/no to multi-value. This option now covers the effects of "find_multipaths" as it used to be, plus the -i option to multipath (ignore_wwids) and the -n option to multipathd (ignore_new_devs), excluding such combinations of the former options that are

[dm-devel] [PATCH v4 03/20] libmultipath: should_multipath: keep existing maps

2018-04-04 Thread Martin Wilck
with find_multipaths "yes" and without the "-n" option to multipathd, if a path is already multipathed, keep it. The same logic is applied by "multipath -u -i". To do this, we need to add a "mpvec" parameter to should_multipath(). Reviewed-by: Benjamin Marzinski

[dm-devel] [PATCH v4 06/20] libmultipath: trigger path uevent only when necessary

2018-04-04 Thread Martin Wilck
Paths that are already classified as DM_MULTIPATH_DEVICE_PATH don't need to be retriggered. Reviewed-by: Benjamin Marzinski Signed-off-by: Martin Wilck --- libmultipath/configure.c | 12 1 file changed, 12 insertions(+) diff --git

[dm-devel] [PATCH v4 02/20] Revert "multipathd: imply -n if find_multipaths is set"

2018-04-04 Thread Martin Wilck
This reverts commit 64e27ec066a001012f44550f095c93443e91d845. Reviewed-by: Benjamin Marzinski Signed-off-by: Martin Wilck --- multipathd/main.c | 4 1 file changed, 4 deletions(-) diff --git a/multipathd/main.c b/multipathd/main.c index

[dm-devel] [PATCH v4 19/20] libmultipath: enable find_multipaths "smart"

2018-04-04 Thread Martin Wilck
This activates "smart" path detection. This is similar to "find_multipaths yes", but doesn't generally ignore single paths that are not listed in the WWIDs file. Rather, such paths are temporarily treated like multipath members. If no additional paths are detected after a certain time, the paths

[dm-devel] [PATCH v4 12/20] multipath -u: change output to environment/key format

2018-04-04 Thread Martin Wilck
... instead of free format. This provides more flexibility for udev rule processing for the future. Adapt code in multipath.rules. The exit status remains as usual. This affects "multipath -c", too. The parameters "pathvec" and "conf" for print_cmd_valid are currently unused, but will be in

[dm-devel] [PATCH v4 04/20] multipath -u -i: respect entries in WWIDs file

2018-04-04 Thread Martin Wilck
Previously, if find_multipaths was set, devices listed in the WWIDs file weren't classified as multipath members by "multipath -u -i" unless they also met the "find_multipaths" criteria (at least two paths, or existing map with this WWID). Now we classify all paths in the WWIDs file as multipath

[dm-devel] [PATCH v4 20/20] multipath.rules: find_multipaths "smart" logic

2018-04-04 Thread Martin Wilck
When the first path to a device appears, we don't know if more paths are going to follow. find_multipath "smart" logic attempts to solve this dilemma by waiting for additional paths for a configurable time before giving up and releasing single paths to upper layers. These rules apply only if both

[dm-devel] [PATCH v4 10/20] libmultipath: indicate wwid failure in dm_addmap_create()

2018-04-04 Thread Martin Wilck
dm_addmap_create() is where we actually try to set up a new multipath map. Depending on the result, mark the wwid as failed (or not), and re-trigger an uevent if necessary. If a path changes from multipath to non-multipath, use an "add" event to make sure LVM2 rules pick it up. Increase log level

[dm-devel] [PATCH v4 13/20] multipath -u: treat failed wwids as invalid

2018-04-04 Thread Martin Wilck
If a WWID has been marked as "failed", don't treat it as "valid multipath device path" in multipath -c/-u. This is key to achieve consistency between multipathd and udev rule processing. Signed-off-by: Martin Wilck --- multipath/main.c | 8 ++-- 1 file changed, 6

[dm-devel] [PATCH v4 15/20] libmultipath: implement find_multipaths_timeout

2018-04-04 Thread Martin Wilck
This makes the timeout for "find_multipaths smart" configurable. If the timeout has a negative value (default), it's applied only to "known" hardware which is either in the hwtable or in a "device" section in multipath.conf. For typical non-multipath hardware, which is not in the hwtable, a short

[dm-devel] [PATCH v4 08/20] libmultipath: use const char* in open_file()

2018-04-04 Thread Martin Wilck
Reviewed-by: Benjamin Marzinski Signed-off-by: Martin Wilck --- libmultipath/file.c | 6 +++--- libmultipath/file.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libmultipath/file.c b/libmultipath/file.c index e4951c9..d5165ec

[dm-devel] [PATCH v4 11/20] multipath -u: common code path for result message

2018-04-04 Thread Martin Wilck
Print the result message in one place only. This simplifies future changes. multipath -c is also affected. Signed-off-by: Martin Wilck --- multipath/main.c | 32 +++- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/multipath/main.c

[dm-devel] [PATCH v4 09/20] libmultipath: functions to indicate mapping failure in /dev/shm

2018-04-04 Thread Martin Wilck
Create a simple API that indicates failure to create a map for a certain WWID. This will allow multipathd to indicate to other tools (in particular, "multipath -u" during udev processing) that an attempt to create a map for a certain wwid failed. The indicator is simply the existence of a file

[dm-devel] [PATCH v4 00/20] multipath path classification

2018-04-04 Thread Martin Wilck
Hello Christophe, This patch set implements a new, improved path detection logic based on the previous discussions in the dm-devel threads "Multipath path classification revisited" and "RFC: multipath path classification", as well as Ben's review of v2 of this series. Up to 08/20, this series is

[dm-devel] [PATCH v4 01/20] Revert "multipath: ignore -i if find_multipaths is set"

2018-04-04 Thread Martin Wilck
This reverts commit ffbb886a8a16cb063d669cd76a1e656fd3ec8c4b. Reviewed-by: Benjamin Marzinski Signed-off-by: Martin Wilck --- multipath/main.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/multipath/main.c b/multipath/main.c index

[dm-devel] [PATCH v4 05/20] libmultipath: trigger change uevent on new device creation

2018-04-04 Thread Martin Wilck
From: Benjamin Marzinski When multipath first sees a path device with find_multipaths enabled, it can't know if the device should be multipathed. This means that it will not claim the device in udev. If the device is eventually multipathed, multipath should trigger a change

Re: [dm-devel] [PATCH 5/6] mpathcmd: fix libmpathcmd license

2018-04-04 Thread Martin Wilck
On Thu, 2018-03-29 at 22:37 -0500, Benjamin Marzinski wrote: > There is no version 2 of the GNU Lesser General Public License, so > change the license header to version 2.1, which does exist. Also copy > the license header to mpath_cmd.c. I've CC'ed everyone who has > contributed code to

Re: [dm-devel] [PATCH 4/6] multipathd: remove unneeded function parameter

2018-04-04 Thread Martin Wilck
On Thu, 2018-03-29 at 22:37 -0500, Benjamin Marzinski wrote: > remove_map_and_stop_waiter was always called with purge_vecs = 1, so > it can simply be removed, as suggested by Martin Wilck > > Cc: Martin Wilck > Signed-off-by: Benjamin Marzinski

Re: [dm-devel] [PATCH 3/6] multipathd: minor dmevents polling code cleanups

2018-04-04 Thread Martin Wilck
On Thu, 2018-03-29 at 22:37 -0500, Benjamin Marzinski wrote: > Change strncpy to strlcpy and lock_cleanup_pop to > pthread_cleanup_pop, > based on suggestions by Martin Wilck > > Cc: Martin Wilck > Signed-off-by: Benjamin Marzinski Reviewed-by: Martin

Re: [dm-devel] [PATCH 2/6] multipath: add comments

2018-04-04 Thread Martin Wilck
On Thu, 2018-03-29 at 22:36 -0500, Benjamin Marzinski wrote: > This commit simply adds a number of comments based on suggestions by > Martin Wilck. > > Cc: Martin Wilck > Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck -- Dr.

Re: [dm-devel] [PATCH 1/6] multipathd: remove incorrect pthread_testcancel

2018-04-04 Thread Martin Wilck
On Thu, 2018-03-29 at 22:36 -0500, Benjamin Marzinski wrote: > As Martin Wilck pointed out, a thread that's trying to stop the > waiter > thread should not cancel itself before it gets a chance to do so > > Cc: Martin Wilck > Fixes: c7625f92 "multipathd: fix waiter thread

Re: [dm-devel] device mapper ioctl handling

2018-04-04 Thread Mikulas Patocka
On Wed, 4 Apr 2018, Mike Snitzer wrote: > On Wed, Apr 04 2018 at 9:34am -0400, > Mikulas Patocka wrote: > > > Hi > > > > I was thinking about that ioctl handling - and the problem is that the > > current code is broken too. The current code does: > > > > 1.

Re: [dm-devel] [PATCH] dm: fix DAX dependency

2018-04-04 Thread Dan Williams
On Wed, Apr 4, 2018 at 2:54 AM, Arnd Bergmann wrote: > Building device mapper with CONFIG_DAX=m now results in a link error: > > drivers/md/dm.o: In function `dm_put_table_device': > dm.c:(.text+0x33c): undefined reference to `put_dax' > drivers/md/dm.o: In function

Re: [dm-devel] device mapper ioctl handling

2018-04-04 Thread Mike Snitzer
On Wed, Apr 04 2018 at 9:34am -0400, Mikulas Patocka wrote: > Hi > > I was thinking about that ioctl handling - and the problem is that the > current code is broken too. The current code does: > > 1. dm_get_live_table > 2. call the "prepare_ioctl" method on the first

Re: [dm-devel] dm: fix DAX dependency

2018-04-04 Thread Mike Snitzer
On Wed, Apr 04 2018 at 5:54am -0400, Arnd Bergmann wrote: > Building device mapper with CONFIG_DAX=m now results in a link error: > > drivers/md/dm.o: In function `dm_put_table_device': > dm.c:(.text+0x33c): undefined reference to `put_dax' > drivers/md/dm.o: In function

[dm-devel] device mapper ioctl handling

2018-04-04 Thread Mikulas Patocka
Hi I was thinking about that ioctl handling - and the problem is that the current code is broken too. The current code does: 1. dm_get_live_table 2. call the "prepare_ioctl" method on the first target, that returns the block device where the ioctl should be forwarded 3. call bdgrab on the

[dm-devel] [PATCH] dm: fix DAX dependency

2018-04-04 Thread Arnd Bergmann
Building device mapper with CONFIG_DAX=m now results in a link error: drivers/md/dm.o: In function `dm_put_table_device': dm.c:(.text+0x33c): undefined reference to `put_dax' drivers/md/dm.o: In function `cleanup_mapped_device': dm.c:(.text+0x1054): undefined reference to `kill_dax'

Re: [dm-devel] [PATCH 1/2] libmultipath: hwhandler auto-detection for ALUA

2018-04-04 Thread Martin Wilck
On Tue, 2018-04-03 at 16:29 -0500, Benjamin Marzinski wrote: > On Tue, Apr 03, 2018 at 10:53:29PM +0200, Martin Wilck wrote: > > On Tue, 2018-04-03 at 15:31 -0500, Benjamin Marzinski wrote: > > > On Tue, Mar 27, 2018 at 11:50:52PM +0200, Martin Wilck wrote: > > > > If the hardware handler isn't