[dm-devel] [PATCH 4/5] libmultipath: change directio get_events() timeout handling

2020-02-18 Thread Benjamin Marzinski
get_events() used a NULL or a zeroed timeout to mean "don't wait". io_getevents() uses a NULL timeout to mean "wait forever" and a zeroed timeout to mean "don't wait". Make get_events() work like io_getevents(). Signed-off-by: Benjamin Marzinski --- libmultipath/checkers/directio.c | 10

[dm-devel] [PATCH 5/5] libmultipath: cleanup old issues with directio checker

2020-02-18 Thread Benjamin Marzinski
The directio checker manually aligns its directio buffer, instead of using posix_memalign(). It also defaults the block size for the read to 512, which may be too small for 4k devices, and it only waits for 5 ns for IO completion before giving up and setting the path to pending, which means that

[dm-devel] [PATCH 1/5] multipath: fix issues found by compiling with gcc 10

2020-02-18 Thread Benjamin Marzinski
Signed-off-by: Benjamin Marzinski --- kpartx/dasd.c| 6 +++--- libmultipath/print.c | 3 ++- multipath/main.c | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/kpartx/dasd.c b/kpartx/dasd.c index 1486ccaa..57305825 100644 --- a/kpartx/dasd.c +++ b/kpartx/dasd.c

[dm-devel] [PATCH 2/5] libmultipath: turn pp->vpd_data into a pointer

2020-02-18 Thread Benjamin Marzinski
Instead of always allocating space in the path structure for vpd_data, only allocte it when necessary. Also, fix comments on vpd tests Signed-off-by: Benjamin Marzinski --- libmultipath/discovery.c | 17 +++-- libmultipath/print.c | 4 ++-- libmultipath/structs.c | 3 +++

[dm-devel] [PATCH 3/5] libmultipath: change loading and resetting in directio

2020-02-18 Thread Benjamin Marzinski
The directio checker previously made sure to always keep an aio_group around after loading or resetting the checker. There is no need to do this, and removing this code simplifies the checker. With this change, there is no longer a need for a load or unload checker function, only a reset function

[dm-devel] [PATCH 0/5] Multipath Follow-up patches

2020-02-18 Thread Benjamin Marzinski
These patches resolve various minor issues that Martin had with my previous patch set. Benjamin Marzinski (5): multipath: fix issues found by compiling with gcc 10 libmultipath: turn pp->vpd_data into a pointer libmultipath: change loading and resetting in directio libmultipath: change

[dm-devel] [PATCH v3 18/18] tests: make directio tests able to work on a real device

2020-02-18 Thread Benjamin Marzinski
There is now a file in tests called directio_test_dev. If the commented out test device line is uncommented and set to a device, it can be used to test the directio checker on that device, instead of faking the device. Signed-off-by: Benjamin Marzinski --- tests/Makefile | 16 +-

[dm-devel] [PATCH v3 03/18] Fix leak in mpathpersist

2020-02-18 Thread Benjamin Marzinski
If the persistent in command fails, the response buffer must be freed. Found by Coverity Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- mpathpersist/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mpathpersist/main.c b/mpathpersist/main.c index 56761668..28bfe410

[dm-devel] [PATCH v3 16/18] fixup! libmultipath: add code to get vendor specific vpd data

2020-02-18 Thread Benjamin Marzinski
From: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/discovery.c | 2 +- libmultipath/propsel.c | 2 +- libmultipath/propsel.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index

[dm-devel] [PATCH v3 12/18] multipathd: add new paths under vecs lock

2020-02-18 Thread Benjamin Marzinski
Right now, multipathd only ever calls pathinfo on a path outside of the vecs lock in one circumstance, when it's adding a new path from a uevent. Doing this can cause weirdness or crash multipathd. First off, the path checker code is written assuming that only one checker instance will be active

[dm-devel] [PATCH v3 09/18] libmultipath: add code to get vendor specific vpd data

2020-02-18 Thread Benjamin Marzinski
This adds the wildcard 'g' for multipath and path formatted printing, which returns extra data from a device's vendor specific vpd page. The specific vendor vpd page to use, and the vendor/product id to decode it can be set in the hwentry with vpd_vendor_pg and vpd_vendor_id. It can be configured

[dm-devel] [PATCH v3 14/18] libmultipath: make directio checker share io contexts

2020-02-18 Thread Benjamin Marzinski
On systems with a large number of cores (>500), io_destroy() can take tens to hundreds of milliseconds to complete, due to RCU synchronization. If there are a large number of paths using the directio checker on such a system, this can lead to multipath taking almost a minute to complete, with the

[dm-devel] [PATCH v3 07/18] libmultipath: fix sgio_get_vpd looping

2020-02-18 Thread Benjamin Marzinski
If do_inq returns a page with a length that is less than maxlen, but larger than DEFAULT_SGIO_LEN, this function will loop forever. Also if do_inq returns with a length equal to or greater than maxlen, sgio_get_vpd will exit immediately, even if it hasn't read the entire page. Fix these issues,

[dm-devel] [PATCH v3 02/18] multipathd: staticify uxlsnr variables/functions

2020-02-18 Thread Benjamin Marzinski
Signed-off-by: Benjamin Marzinski --- multipathd/uxlsnr.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/multipathd/uxlsnr.c b/multipathd/uxlsnr.c index 020d7a9b..1c5ce9d2 100644 --- a/multipathd/uxlsnr.c +++ b/multipathd/uxlsnr.c @@ -40,7 +40,7 @@ #include

[dm-devel] [PATCH v3 13/18] libmultipath: add new checker class functions

2020-02-18 Thread Benjamin Marzinski
This commit adds the optional functions libcheck_load, libcheck_unload, and libcheck_reset. libcheck_load is called when a checker is first loaded, libcheck_unload is called when it is unloaded, and libcheck_reset is called during reconfigure, after all the current paths have been removed. They

[dm-devel] [PATCH v3 05/18] libmultipath: constify get_unaligned_be*

2020-02-18 Thread Benjamin Marzinski
Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/unaligned.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmultipath/unaligned.h b/libmultipath/unaligned.h index 68c07742..b9eaa7cb 100644 --- a/libmultipath/unaligned.h +++

[dm-devel] [PATCH v3 10/18] libmultipath: change how the checker async is set

2020-02-18 Thread Benjamin Marzinski
The way that the checkers async mode worked in multipathd didn't make much sense. When multipathd starts up, all checker classes are in the sync mode, and any pathinfo() calls on devices would run the checker in sync mode. However, the First time a checker class was used in checkerloop, it would

[dm-devel] [PATCH v3 04/18] libmultipath: remove unused path->prio_args

2020-02-18 Thread Benjamin Marzinski
Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/structs.h | 1 - 1 file changed, 1 deletion(-) diff --git a/libmultipath/structs.h b/libmultipath/structs.h index c978fb8a..250623af 100644 --- a/libmultipath/structs.h +++ b/libmultipath/structs.h @@ -273,7 +273,6 @@

[dm-devel] [PATCH v3 08/18] libmultipath: add vend_id to get_vpd_sgio

2020-02-18 Thread Benjamin Marzinski
This tells multipath how it should decode vendor specific pages. It will be used by a future patch. Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/discovery.c | 4 ++-- libmultipath/discovery.h | 2 +- libmultipath/propsel.c | 2 +- tests/vpd.c |

[dm-devel] [PATCH v3 01/18] multipathd: warn when configuration has been changed.

2020-02-18 Thread Benjamin Marzinski
It would be helpful if multipathd could log a message when multipath.conf or files in the config_dir have been written to, both so that it can be used to send a notification to users, and to help with determining after the fact if multipathd was running with an older config, when the logs of

[dm-devel] [PATCH v3 00/18] Multipath patch dump

2020-02-18 Thread Benjamin Marzinski
This patch set is has multiple parts. patch 01 is just a resubmit of my previous patch, with Martin's corrections added. Patches 02 - 06 are miscellaneous fixes and cleanups Patches 07 - 09 are related to adding a new format wildcard, at the request of HPE, that allows multipath to get

[dm-devel] [PATCH v3 11/18] libmultipath: change failed path prio timeout

2020-02-18 Thread Benjamin Marzinski
multipath will try to get the priority from a PATH_DOWN path, if the path doesn't currently have a valid priority. However, if the priority code needs to contact the device to get the priority, this is likely to fail for PATH_DOWN paths. This code dates back to when multipathd could not easily

[dm-devel] [PATCH v3 15/18] tests: add directio unit tests

2020-02-18 Thread Benjamin Marzinski
Signed-off-by: Benjamin Marzinski --- tests/Makefile | 3 +- tests/directio.c | 704 +++ 2 files changed, 706 insertions(+), 1 deletion(-) create mode 100644 tests/directio.c diff --git a/tests/Makefile b/tests/Makefile index c9406e75..e9081e8f

[dm-devel] [PATCH v3 06/18] libmultipath: add missing hwe mpe variable merges

2020-02-18 Thread Benjamin Marzinski
There were some variables in the hwe and mpe structs that weren't being merged by merge_hwe() and merge_mpe(). Reviewed-by: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/config.c | 8 1 file changed, 8 insertions(+) diff --git a/libmultipath/config.c

[dm-devel] [PATCH v3 17/18] fixup! libmultipath: make directio checker share io contexts

2020-02-18 Thread Benjamin Marzinski
From: Martin Wilck Signed-off-by: Benjamin Marzinski --- libmultipath/checkers/directio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmultipath/checkers/directio.c b/libmultipath/checkers/directio.c index 740c68e5..813e61e2 100644 ---

[dm-devel] [PATCH v5 1/8] pmem: Add functions for reading/writing page to/from pmem

2020-02-18 Thread Vivek Goyal
This splits pmem_do_bvec() into pmem_do_read() and pmem_do_write(). pmem_do_write() will be used by pmem zero_page_range() as well. Hence sharing the same code. Suggested-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Signed-off-by: Vivek Goyal --- drivers/nvdimm/pmem.c | 86

[dm-devel] [PATCH v5 6/8] dm, dax: Add dax zero_page_range operation

2020-02-18 Thread Vivek Goyal
This patch adds support for dax zero_page_range operation to dm targets. Signed-off-by: Vivek Goyal --- drivers/md/dm-linear.c| 21 + drivers/md/dm-log-writes.c| 19 +++ drivers/md/dm-stripe.c| 26 ++

[dm-devel] [PATCH v5 4/8] dax, pmem: Add a dax operation zero_page_range

2020-02-18 Thread Vivek Goyal
Add a dax operation zero_page_range, to zero a range of memory. This will also clear any poison in the range being zeroed. As of now, zeroing of up to one page is allowed in a single call. There are no callers which are trying to zero more than a page in a single call. Once we grow the callers

[dm-devel] [PATCH v5 2/8] drivers/pmem: Allow pmem_clear_poison() to accept arbitrary offset and len

2020-02-18 Thread Vivek Goyal
Currently pmem_clear_poison() expects offset and len to be sector aligned. Atleast that seems to be the assumption with which code has been written. It is called only from pmem_do_bvec() which is called only from pmem_rw_page() and pmem_make_request() which will only passe sector aligned offset

[dm-devel] [PATCH v5 7/8] dax, iomap: Start using dax native zero_page_range()

2020-02-18 Thread Vivek Goyal
Get rid of calling block device interface for zeroing in iomap dax zeroing path and use dax native zeroing interface instead. Suggested-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Signed-off-by: Vivek Goyal --- fs/dax.c | 45 + 1 file

[dm-devel] [PATCH v5 8/8] dax, iomap: Add helper dax_iomap_zero() to zero a range

2020-02-18 Thread Vivek Goyal
Add a helper dax_ioamp_zero() to zero a range. This patch basically merges __dax_zero_page_range() and iomap_dax_zero(). Suggested-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Signed-off-by: Vivek Goyal --- fs/dax.c | 12 ++-- fs/iomap/buffered-io.c | 9

[dm-devel] [PATCH v5 5/8] s390, dcssblk, dax: Add dax zero_page_range operation to dcssblk driver

2020-02-18 Thread Vivek Goyal
Add dax operation zero_page_range for dcssblk driver. CC: linux-s...@vger.kernel.org Suggested-by: Christoph Hellwig Reviewed-by: Gerald Schaefer Signed-off-by: Vivek Goyal --- drivers/s390/block/dcssblk.c | 17 + 1 file changed, 17 insertions(+) diff --git

[dm-devel] [PATCH v5 3/8] pmem: Enable pmem_do_write() to deal with arbitrary ranges

2020-02-18 Thread Vivek Goyal
Currently pmem_do_write() is written with assumption that all I/O is sector aligned. Soon I want to use this function in zero_page_range() where range passed in does not have to be sector aligned. Modify this function to be able to deal with an arbitrary range. Which is specified by pmem_off and

Re: [dm-devel] [PATCH v4 2/7] pmem: Enable pmem_do_write() to deal with arbitrary ranges

2020-02-18 Thread Vivek Goyal
On Tue, Feb 18, 2020 at 09:09:28AM -0800, Christoph Hellwig wrote: > On Mon, Feb 17, 2020 at 01:16:48PM -0500, Vivek Goyal wrote: > > Currently pmem_do_write() is written with assumption that all I/O is > > sector aligned. Soon I want to use this function in zero_page_range() > > where range

Re: [dm-devel] [PATCH v4 1/7] pmem: Add functions for reading/writing page to/from pmem

2020-02-18 Thread Christoph Hellwig
On Mon, Feb 17, 2020 at 01:16:47PM -0500, Vivek Goyal wrote: > This splits pmem_do_bvec() into pmem_do_read() and pmem_do_write(). > pmem_do_write() will be used by pmem zero_page_range() as well. Hence > sharing the same code. > > Suggested-by: Christoph Hellwig > Signed-off-by: Vivek Goyal

Re: [dm-devel] [PATCH v4 3/7] dax, pmem: Add a dax operation zero_page_range

2020-02-18 Thread Christoph Hellwig
> +static int pmem_dax_zero_page_range(struct dax_device *dax_dev, u64 offset, > + size_t len) > +{ > + struct pmem_device *pmem = dax_get_private(dax_dev); > + blk_status_t rc; > + > + rc = pmem_do_write(pmem, ZERO_PAGE(0), 0, offset, len); > +

Re: [dm-devel] [PATCH v4 2/7] pmem: Enable pmem_do_write() to deal with arbitrary ranges

2020-02-18 Thread Christoph Hellwig
On Mon, Feb 17, 2020 at 01:16:48PM -0500, Vivek Goyal wrote: > Currently pmem_do_write() is written with assumption that all I/O is > sector aligned. Soon I want to use this function in zero_page_range() > where range passed in does not have to be sector aligned. > > Modify this function to be