Re: [dm-devel] [PATCH] block: move some macros to blkdev.h

2021-08-11 Thread Jens Axboe
On 7/20/21 8:53 PM, Guoqing Jiang wrote: > From: Guoqing Jiang > > Move them (PAGE_SECTORS_SHIFT, PAGE_SECTORS and SECTOR_MASK) to the > generic header file to remove redundancy. Applied for 5.15, thanks. -- Jens Axboe -- dm-devel mailing list dm-devel@redhat.com

Re: [dm-devel] [PATCH] block: move some macros to blkdev.h

2021-08-11 Thread Guoqing Jiang
Gentle ping ... On 7/21/21 10:53 AM, Guoqing Jiang wrote: From: Guoqing Jiang Move them (PAGE_SECTORS_SHIFT, PAGE_SECTORS and SECTOR_MASK) to the generic header file to remove redundancy. Signed-off-by: Guoqing Jiang --- drivers/block/brd.c | 3 ---

[dm-devel] [PATCH v2 2/9] libmultipath: strbuf: simple api for growing string buffers

2021-08-11 Thread mwilck
From: Martin Wilck Add an API for string buffers that grow in size as text is added. This API will be useful in several places of the multipath-tools code base. Add unit tests for these helpers, too. Signed-off-by: Martin Wilck --- libmultipath/Makefile | 2 +- libmultipath/strbuf.c | 207

[dm-devel] [PATCH v2 7/9] libmultipath: print.h: move macros to print.c

2021-08-11 Thread mwilck
From: Martin Wilck Move all macros to print.c that aren't used in other source files. Reviewed-by: Benjamin Marzinski Signed-off-by: Martin Wilck --- libmultipath/print.c | 66 + libmultipath/print.h | 70 +--- 2

[dm-devel] [PATCH v2 6/9] libmultipath: print.c: fail hard if keywords are not found

2021-08-11 Thread mwilck
From: Martin Wilck A failure in find_keyword() means an internal error. Fail hard rather than returning an empty string. Reviewed-by: Benjamin Marzinski Signed-off-by: Martin Wilck --- libmultipath/print.c | 101 +++ 1 file changed, 35 insertions(+),

[dm-devel] [PATCH v2 5/9] libmultipath: use strbuf in print.c

2021-08-11 Thread mwilck
From: Martin Wilck Use the strbuf API in print.c, wherever growing string buffers are appropriate. This requires a large amount of changes in print.c itself, and in other files that use functions from print.c. It makes no sense to separate this into smaller patches though, as the various

[dm-devel] [PATCH v2 1/9] libmultipath: variable-size parameters in dm_get_map()

2021-08-11 Thread mwilck
From: Martin Wilck We've seen a crash of multipath in disassemble_map because of a params string exceeding PARAMS_SIZE. While the crash could have been fixed by a simple error check, I believe multipath should be able to work with arbitrary long parameter strings passed from the kernel. The

[dm-devel] [PATCH v2 8/9] libmultipath: use strbuf in alias.c.

2021-08-11 Thread mwilck
From: Martin Wilck We can avoid some buffer length checks here, too. Also, simplify the implementation of format_devname(). Created a wrapper for the format_devname() test case, to avoid chaning the test cases themselves. Reviewed-by: Benjamin Marzinski Signed-off-by: Martin Wilck ---

[dm-devel] [PATCH v2 9/9] multipathd: use strbuf in cli.c

2021-08-11 Thread mwilck
From: Martin Wilck Here, too, strbuf can be used to simplify code. Reviewed-by: Benjamin Marzinski Signed-off-by: Martin Wilck --- multipathd/cli.c | 94 ++-- 1 file changed, 34 insertions(+), 60 deletions(-) diff --git a/multipathd/cli.c

[dm-devel] [PATCH v2 0/9] multipath-tools: use variable-size string buffers

2021-08-11 Thread mwilck
From: Martin Wilck Current libmultipath contains a lot of code writing text to pre-allocated string buffers of fixed size while trying to avoid buffer overflows or truncation of the output string. This code is, at least in part, hard to verify and hard to read, as buffer sizes and positions need

[dm-devel] [PATCH v2 4/9] libmultipath: use strbuf in dict.c

2021-08-11 Thread mwilck
From: Martin Wilck Temporary solution for snprint_keyword(), as print.c hasn't been migrated yet. Signed-off-by: Martin Wilck --- libmultipath/dict.c| 314 ++--- libmultipath/dict.h| 19 +-- libmultipath/parser.c | 47 +++---

[dm-devel] [PATCH v2 3/9] libmultipath: variable-size parameters in assemble_map()

2021-08-11 Thread mwilck
From: Martin Wilck Instead of using fixed PARAMS_SIZE-sized arrays for parameters, use dynamically allocated memory. The library version needs to be bumped, because setup_map() argument list has changed. Signed-off-by: Martin Wilck --- libmultipath/configure.c | 18 ++--

Re: [dm-devel] [PATCH 4/9] libmultipath: use strbuf in dict.c

2021-08-11 Thread Martin Wilck
On Mi, 2021-07-28 at 14:03 -0500, Benjamin Marzinski wrote: > On Thu, Jul 15, 2021 at 12:52:18PM +0200, mwi...@suse.com wrote: > > From: Martin Wilck > > > > Temporary solution for snprint_keyword(), as print.c hasn't been > > migrated yet. > > Mostly good. I have some minor issues with this. >

Re: [dm-devel] [PATCH 2/9] libmultipath: strbuf: simple api for growing string buffers

2021-08-11 Thread Martin Wilck
On Mo, 2021-07-26 at 23:54 -0500, Benjamin Marzinski wrote: > On Thu, Jul 15, 2021 at 12:52:16PM +0200, mwi...@suse.com wrote: > > From: Martin Wilck > > > > Add an API for string buffers that grow in size as text is added. > > This API will be useful in several places of the multipath-tools > >

Re: [dm-devel] [PATCH 1/9] libmultipath: variable-size parameters in dm_get_map()

2021-08-11 Thread Martin Wilck
On Mo, 2021-07-26 at 17:17 -0500, Benjamin Marzinski wrote: > On Thu, Jul 15, 2021 at 12:52:15PM +0200, mwi...@suse.com wrote: > > From: Martin Wilck > > > > -int dm_get_status(const char *name, char *outstatus) > > +int dm_get_status(const char *name, char **outstatus) > >  { > > int r

Re: [dm-devel] [PATCH v2 2/9] libmultipath: strbuf: simple api for growing string buffers

2021-08-11 Thread Bart Van Assche
On 8/11/21 8:41 AM, mwi...@suse.com wrote: Add an API for string buffers that grow in size as text is added. This API will be useful in several places of the multipath-tools code base. Add unit tests for these helpers, too. Has it been considered to switch to C++ and use std::string and/or

[dm-devel] [PATCH] libmultipath: fix compile error with glibc-2.34+

2021-08-11 Thread lixiaokeng
There is an error when complie with glibc-2.34: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'long int' [-Werror=sign-compare] The reason is that PTHREAD_STACK_MIN may be defined long int which is signed in glibc-2.34+. Explicitly assign it to

Re: [dm-devel] [PATCH 4/8] block: support delayed holder registration

2021-08-11 Thread Marek Szyprowski
Hi, On 04.08.2021 11:41, Christoph Hellwig wrote: > device mapper needs to register holders before it is ready to do I/O. > Currently it does so by registering the disk early, which can leave > the disk and queue in a weird half state where the queue is registered > with the disk, except for