[dm-devel] [PATCH v2 0/6] multipath: path validation library prep work

2020-05-18 Thread Benjamin Marzinski
I've been playing around with the SID code more and I've decided to hold off on submitting the library until I have it working with the SID multipath module better. Instead, I've pulled out the common code that multipath -u/-c and the library can use, and put it into libmultipath. I've also remove

[dm-devel] [PATCH v2 2/6] libmultipath: make sysfs_is_multipathed able to return wwid

2020-05-18 Thread Benjamin Marzinski
sysfs_is_multipathed reads the wwid of the dm device holding a path to check if its a multipath device. Add code to optinally set pp->wwid to that wwid. This will be used by a future patch. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/sysfs.c | 24 +

[dm-devel] [PATCH v2 4/6] Unit tests for is_path_valid()

2020-05-18 Thread Benjamin Marzinski
Signed-off-by: Benjamin Marzinski --- tests/Makefile | 4 +- tests/valid.c | 486 + 2 files changed, 489 insertions(+), 1 deletion(-) create mode 100644 tests/valid.c diff --git a/tests/Makefile b/tests/Makefile index 77ff3249..7fc261c3 100644

[dm-devel] [PATCH v2 6/6] libmultipath: use atomic linkat() in mark_failed_wwid()

2020-05-18 Thread Benjamin Marzinski
From: Martin Wilck This keeps (almost) the simplicity of the previous patch, while making sure that the return value of mark_failed_wwid() (WWID_FAILED_CHANGED vs. WWID_FAILED_UNCHANGED) is correct, even if several processes access this WWID at the same time. Signed-off-by: Martin Wilck Signed-

[dm-devel] [PATCH v2 1/6] libmultipath: make libmp_dm_init optional

2020-05-18 Thread Benjamin Marzinski
Move dm_initialized out of libmp_dm_task_create(), and add a function skip_libmp_dm_init() so that users of libmultipath can skip initializing device-mapper. This is needed for other programs that use libmultipath (or a library that depends on it) but want to control how device-mapper is set up. A

[dm-devel] [PATCH v2 5/6] libmultipath: simplify failed wwid code

2020-05-18 Thread Benjamin Marzinski
The (is|mark|unmark)_failed_wwid code is needlessly complicated. Locking a file is necssary if multiple processes could otherwise be writing to it at the same time. That is not the case with the failed_wwids files. They can simply be empty files in a directory. Even with all the locking in place,

[dm-devel] [PATCH v2 3/6] multipath: centralize validation code

2020-05-18 Thread Benjamin Marzinski
This code pulls the multipath path validation code out of configure(), and puts it into its own function, check_path_valid(). This function calls a new libmultipath function, is_path_valid() to check just path requested. This seperation exists so that is_path_valid() can be reused by future code. T

[dm-devel] [dm:dm-5.8 50/54] drivers/md/dm-zoned-metadata.c:2468:6: warning: no previous prototype for 'dmz_print_dev'

2020-05-18 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git dm-5.8 head: 44eaf01834bc7414ab5298d097ed4e142a714420 commit: 4813c868bef0182b7ca7662f967b1c4bfdff1c1e [50/54] dm zoned: add metadata logging functions config: parisc-randconfig-r024-20200519 (attached as .confi

Re: [dm-devel] [dm:dm-5.8 47/54] drivers/md/dm-zoned-reclaim.c:350:18: warning: variable 'dev' set but not used

2020-05-18 Thread Damien Le Moal
On 2020/05/19 12:18, kbuild test robot wrote: > tree: > https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git > dm-5.8 > head: 44eaf01834bc7414ab5298d097ed4e142a714420 > commit: 21a33c39f41e5fc4e9ecfdf958190c9dc4a86b94 [47/54] dm zoned: remove > 'dev' argument from recla

[dm-devel] [dm:dm-5.8 47/54] drivers/md/dm-zoned-reclaim.c:350:18: warning: variable 'dev' set but not used

2020-05-18 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git dm-5.8 head: 44eaf01834bc7414ab5298d097ed4e142a714420 commit: 21a33c39f41e5fc4e9ecfdf958190c9dc4a86b94 [47/54] dm zoned: remove 'dev' argument from reclaim config: parisc-randconfig-r024-20200519 (attached as .c

Re: [dm-devel] next-20200514 - build issue in drivers/md/dm-zoned-target.c

2020-05-18 Thread Valdis Klētnieks
On Mon, 18 May 2020 12:44:49 -0400, Mike Snitzer said: > Unless I'm missing something it was fixed up with this commit last > wednesday (13th): > > https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-5.8&id=81a3a1453ec4e5da081e1395732801a600feb352 That says: a

Re: [dm-devel] [PATCH 3/6] multipath: centralize validation code

2020-05-18 Thread Martin Wilck
On Mon, 2020-05-18 at 13:53 -0500, Benjamin Marzinski wrote: > On Fri, May 15, 2020 at 08:37:16PM +, Martin Wilck wrote: > > On Thu, 2020-05-14 at 20:59 -0500, Benjamin Marzinski wrote: > > > This code pulls the multipath path validation code out of > > > configure(), > > > and puts it into its

Re: [dm-devel] [PATCH 4/6] Unit tests for is_path_valid()

2020-05-18 Thread Benjamin Marzinski
On Fri, May 15, 2020 at 08:37:23PM +, Martin Wilck wrote: > On Thu, 2020-05-14 at 20:59 -0500, Benjamin Marzinski wrote: > > Signed-off-by: Benjamin Marzinski > > Two minor nits below, otherwise ack. Sure. I can fix those up. -Ben > > > --- > > tests/Makefile | 4 +- > > tests/valid.c

Re: [dm-devel] [PATCH 3/6] multipath: centralize validation code

2020-05-18 Thread Benjamin Marzinski
On Fri, May 15, 2020 at 08:37:16PM +, Martin Wilck wrote: > On Thu, 2020-05-14 at 20:59 -0500, Benjamin Marzinski wrote: > > This code pulls the multipath path validation code out of > > configure(), > > and puts it into its own function, check_path_valid(). This function > > calls a new libmul

Re: [dm-devel] next-20200514 - build issue in drivers/md/dm-zoned-target.c

2020-05-18 Thread Mike Snitzer
On Mon, May 18 2020 at 2:25am -0400, Hannes Reinecke wrote: > On 5/16/20 1:19 PM, Valdis Klētnieks wrote: > >Am seeing a build error in next-0514. -0420 built OK. > >building a 'make allmodconfig' on a RPi4 in 32-bit mode. > > > > MODPOST 7575 modules > >ERROR: modpost: "__aeabi_uldivmod" [dr

[dm-devel] [PATCH] multipath-tools: Fix compiler warnings when built without systemd.

2020-05-18 Thread Marius Bakke
--- libmultipath/config.c | 2 +- multipathd/main.c | 19 +-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/libmultipath/config.c b/libmultipath/config.c index b4d87689..a28dc4f2 100644 --- a/libmultipath/config.c +++ b/libmultipath/config.c @@ -696,7 +696,7

[dm-devel] [PATCH] dm: replace strncpy() with strscpy()

2020-05-18 Thread Miles Chen
Replace strncpy() with strscpy() to guarantee a NULL-terminated string. Detected by Coverity. Signed-off-by: Miles Chen --- drivers/md/dm-ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index ac83f5002ce5..4dc3658e3351 10

Re: [dm-devel] [RFC PATCH v3 00/12] Integrity Policy Enforcement LSM (IPE)

2020-05-18 Thread Jaskaran Singh Khurana
Hello Mickael, On Thu, 14 May 2020, Mickaël Salaün wrote: On 12/05/2020 22:46, Deven Bowers wrote: On 5/11/2020 11:03 AM, Deven Bowers wrote: On 5/10/2020 2:28 AM, Mickaël Salaün wrote: [...snip] Additionally, rules are evaluated top-to-bottom. As a result, any revocation rules, or