[dm-devel] [RFC PATCH 1/2] dm crypt: Allow unaligned bio buffer lengths for skcipher devices

2020-09-16 Thread Sudhakar Panneerselvam
crypt_convert_block_skcipher() rejects the I/O if the buffer length is not a multiple of its sector size. This assumption holds true as long as the originator of the I/Os are within Linux. But, in a QEMU environment, with windows as guests that uses vhost-scsi interface, it was observed that block

[dm-devel] [RFC PATCH 2/2] dm crypt: Handle unaligned bio buffer lengths for lmk and tcw

2020-09-16 Thread Sudhakar Panneerselvam
Us sg_miter_* apis to process unaligned buffer lengths while handling bio buffers for lmk and tcw IV generation algorithms. Signed-off-by: Sudhakar Panneerselvam --- drivers/md/dm-crypt.c | 104 +- 1 file changed, 68 insertions(+), 36 deletions(-)

[dm-devel] [RFC PATCH 0/2] dm crypt: Allow unaligned buffer lengths for skcipher devices

2020-09-16 Thread Sudhakar Panneerselvam
Hi, This changeset allows processing of unaligned bio requests in dm crypt for the I/Os generated from a windows guest OS in a QEMU environment. If this changeset is accepted, then I will be submitting another changeset that addresses the similar issue in AEAD disks and dm-integrity module. Thank

[dm-devel] [PATCH 2/2] libmultipath: copy mpp->hwe from pp->hwe

2020-09-16 Thread mwilck
From: Martin Wilck Since f0462f0 ("libmultipath: use vector for for pp->hwe and mp->hwe"), we've been trying to fix issues caused by paths getting freed and mpp->hwe dangling. This approach couldn't work because we need mpp->hwe to persist, even if all paths are removed from the map. Before f0462

[dm-devel] [PATCH 1/2] libmultipath: find_mpe(): don't match with empty WWID

2020-09-16 Thread mwilck
From: Martin Wilck Signed-off-by: Martin Wilck --- libmultipath/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmultipath/config.c b/libmultipath/config.c index b9bdbdb..df0f8f4 100644 --- a/libmultipath/config.c +++ b/libmultipath/config.c @@ -147,7 +147,7 @@ st

[dm-devel] [PATCH] libmultipath: fix memory leak in _check_bindings_file

2020-09-16 Thread mwilck
From: Martin Wilck We must pass "&line" to the cleanup function, not "line". Fixes: "libmultipath: add consistency check for alias settings" Signed-off-by: Martin Wilck --- libmultipath/alias.c | 2 +- libmultipath/util.c | 8 libmultipath/util.h | 1 + 3 files changed, 10 insertion

[dm-devel] [PATCH 12/19] libmultipath: constify file argument in config parser

2020-09-16 Thread mwilck
From: Martin Wilck Signed-off-by: Martin Wilck --- libmultipath/config.c | 3 +-- libmultipath/config.h | 2 +- libmultipath/parser.c | 9 + libmultipath/parser.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libmultipath/config.c b/libmultipath/config.c index b

[dm-devel] [PATCH 15/19] multipath: use {get_put}_multipath_config from libmultipath

2020-09-16 Thread mwilck
From: Martin Wilck Signed-off-by: Martin Wilck --- multipath/main.c | 20 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/multipath/main.c b/multipath/main.c index 650977c..2f5ddd9 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -68,7 +68,6 @@ int

[dm-devel] [PATCH 05/19] multipathd: use volatile qualifier for running_state

2020-09-16 Thread mwilck
From: Martin Wilck While we access running_state only under the config_lock, we sometimes do in a loop. Use the volatile qualifier to make sure compilers can't optimize away the loads. Signed-off-by: Martin Wilck --- multipathd/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[dm-devel] [PATCH 07/19] multipathd: set_config_state(): avoid code duplication

2020-09-16 Thread mwilck
From: Martin Wilck Use __post_config_state() and __wait_for_state_change(). This way __post_config_state() is the only place where running_state is ever changed, and we avoid code duplication. Signed-off-by: Martin Wilck --- multipathd/main.c | 23 +-- 1 file changed, 5 ins

[dm-devel] [PATCH 17/19] libmultipath: add udev and logsink symbols

2020-09-16 Thread mwilck
From: Martin Wilck With these symbols added, applications using libmultipath don't need to define global variables "udev" and "logsink" any more. This comes at the cost of having to call an init function. Currently, libmultipath_init() does nothing but initialize "udev". The linker's symbol look

[dm-devel] [PATCH 13/19] libmultipath: provide defaults for {get, put}_multipath_config

2020-09-16 Thread mwilck
From: Martin Wilck Add an implementation of get_multipath_config() and put_multipath_config() to libmultipath. The linker's symbol lookup rules will make sure that applications can override these functions if they need to. Defining these functions in libmultipath avoids the need to provide stubs

[dm-devel] [PATCH 11/19] libmultipath: protect racy libdevmapper calls with a mutex

2020-09-16 Thread mwilck
From: Martin Wilck dm_udev_wait() and dm_task_run() may access global / static state in libdevmapper. They need to be protected by a lock in in our multithreaded library. Cc: lixiaok...@huawei.com Cc: Zdenek Kabelac Signed-off-by: Martin Wilck --- libmultipath/devmapper.c | 73 +++

[dm-devel] [PATCH 08/19] multipathd: cancel threads early during shutdown

2020-09-16 Thread mwilck
From: Martin Wilck Cancel the other threads before taking vecs->lock. This avoids delays during shutdown caused e.g. by the checker thread holding the vecs lock. Note: this makes it possible that cancelled threads leak memory, because they can now be cancelled before having released the vecs loc

[dm-devel] [PATCH 01/19] multipathd: allow shutdown during configure()

2020-09-16 Thread mwilck
From: Martin Wilck reconfigure() can be a long-running operation; both initial path discovery and initial map setup can take a long time. Allow the main program to indicate that the process should be interrupted if a shutdown signal was received. We take advantage of the dynamic linker's symbol

[dm-devel] [PATCH 04/19] multipathd: send "RELOADING=1" to systemd on DAEMON_CONFIGURE state

2020-09-16 Thread mwilck
From: Martin Wilck The logic is as follows: child() sets DAEMON_IDLE status after DAEMON_CONFIGURE when reconfigure() has finished. The only other state change that can race with that is DAEMON_SHUTDOWN. Other state changes will wait for DAEMON_IDLE first (see set_config_state()). When DAEMON_CON

[dm-devel] [PATCH 09/19] multipath-tools: don't call dm_lib_release() any more

2020-09-16 Thread mwilck
From: Martin Wilck The purpose of dm_lib_release() is to release stacked device node operations in libdevmapper. This is functionality we don't need and use any more, as we rely on udev to set up device nodes and symlinks. We always set DM_UDEV_DISABLE_LIBRARY_FALLBACK when we run dm tasks. In t

[dm-devel] [PATCH 16/19] mpathpersist: use {get, put}_multipath_config() from libmultipath

2020-09-16 Thread mwilck
From: Martin Wilck Signed-off-by: Martin Wilck --- mpathpersist/main.c | 16 ++-- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/mpathpersist/main.c b/mpathpersist/main.c index 28bfe41..0f0db4b 100644 --- a/mpathpersist/main.c +++ b/mpathpersist/main.c @@ -43,17 +43,

[dm-devel] [PATCH 06/19] multipathd: generalize and fix wait_for_state_change_if()

2020-09-16 Thread mwilck
From: Martin Wilck It's unlikely but not impossible that other threads change the state while we're waiting, and if we grab the lock again, it's still not what we wanted. We need to continue waiting until either the condition is met, or time timeout expired. Moreover, generalize this code so tha

[dm-devel] [PATCH 19/19] mpathpersist: remove logsink and udev

2020-09-16 Thread mwilck
From: Martin Wilck We can use libmultipath's internal symbols now. Signed-off-by: Martin Wilck --- mpathpersist/main.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mpathpersist/main.c b/mpathpersist/main.c index 0f0db4b..729857f 100644 --- a/mpathpersist/main.

[dm-devel] [PATCH 03/19] multipathd: send "STOPPING=1" to systemd on shutdown

2020-09-16 Thread mwilck
From: Martin Wilck Inform systemd that the daemon is shutting down. See sd_notify(3). Signed-off-by: Martin Wilck --- multipathd/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/multipathd/main.c b/multipathd/main.c index afc6c99..2923c08 100644 --- a/multipathd/ma

[dm-devel] [PATCH 02/19] multipathd: avoid sending "READY=1" to systemd on early shutdown

2020-09-16 Thread mwilck
From: Martin Wilck If multipathd gets a shutdown request during initial reconfigure(), it shouldn't send "READY=1" to systemd. Ensure this by sending "READY=1" via post_config_state(). Signed-off-by: Martin Wilck --- multipathd/main.c | 16 +++- 1 file changed, 7 insertions(+), 9 d

[dm-devel] [PATCH 14/19] libmpathpersist: allow using libmultipath {get, put}_multipath_config

2020-09-16 Thread mwilck
From: Martin Wilck Provide an alternative init function libmpathpersist_init() which avoids allocating a new struct config, simply using libmultipath's internal implementation. Signed-off-by: Martin Wilck --- libmpathpersist/mpath_persist.c | 42 - libmpathpersi

[dm-devel] [PATCH 18/19] multipath: remove logsink and udev

2020-09-16 Thread mwilck
From: Martin Wilck We can use libmultipath's symbols now. Signed-off-by: Martin Wilck --- multipath/main.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/multipath/main.c b/multipath/main.c index 2f5ddd9..6a2a188 100644 --- a/multipath/main.c +++ b/multipath/main.c

[dm-devel] [PATCH 00/19] multipath-tools: shutdown, libdevmapper races, globals

2020-09-16 Thread mwilck
From: Martin Wilck Hi Christophe, hi Ben, this series contains a number of patches I've wanted to do for some time. As usual, it's based on my "upstream-queue" tree (https://github.com/openSUSE/multipath-tools/tree/upstream-queue). Patch 1-8 are related to multipathd shutdown and systemd notifc

[dm-devel] [PATCH 10/19] libmultipath: devmapper: refactor libdm version determination

2020-09-16 Thread mwilck
From: Martin Wilck As one step towards bundling all possibly racy libdm init calls into a single function, split the code for determining and checking versions of libdm and kernel components. Provide a generic helper libmp_get_version() that makes sure the versions are "lazily" initialized. Note

Re: [dm-devel] [PATCH 3/3] libmultipath: add ignore_udev_uid option

2020-09-16 Thread Martin Wilck
Hi Ben, On Tue, 2020-09-15 at 16:45 -0500, Benjamin Marzinski wrote: > Setting this option to yes will force multipath to get the uid by > using > the fallback sysfs methods, instead of getting it from udev. This > will > cause devices that can't get their uid from the standard locations to > not

Re: [dm-devel] [PATCH 2/3] libmultipath: add uid failback for dasd devices

2020-09-16 Thread Martin Wilck
On Tue, 2020-09-15 at 16:45 -0500, Benjamin Marzinski wrote: > Add failback code to get the uid for dasd devices from sysfs. Copied > from dasdinfo > > Signed-off-by: Benjamin Marzinski Reviewed-by: Martin Wilck -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listi

Re: [dm-devel] [PATCH 1/3] multipath: add libmpathvalid library

2020-09-16 Thread Martin Wilck
On Tue, 2020-09-15 at 16:45 -0500, Benjamin Marzinski wrote: > This library allows other programs to check if a path should be > claimed > by multipath. It exports an init and exit function, a pointer to a > struct config, that stores the configuration which is dealt with in > the > init and exit f

Re: [dm-devel] [PATCH v2 4/4] dm: unconditionally call blk_queue_split() in dm_process_bio()

2020-09-16 Thread Ming Lei
On Tue, Sep 15, 2020 at 11:39:46PM -0400, Mike Snitzer wrote: > On Tue, Sep 15 2020 at 9:48pm -0400, > Ming Lei wrote: > > > On Tue, Sep 15, 2020 at 09:28:14PM -0400, Mike Snitzer wrote: > > > On Tue, Sep 15 2020 at 9:08pm -0400, > > > Ming Lei wrote: > > > > > > > On Tue, Sep 15, 2020 at 01: