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

2020-09-29 Thread Martin Wilck
On Tue, 2020-09-29 at 00:57 -0500, Benjamin Marzinski wrote: > On Thu, Sep 24, 2020 at 03:37:06PM +0200, mwi...@suse.com wrote: > > From: Martin Wilck > > > > dm_udev_wait() and dm_task_run() may access global / static state > > in libdevmapper. They need to be pr

Re: [dm-devel] [PATCH v2 2/2] multipath: Extend program description in manpage

2020-09-26 Thread Martin Wilck
On Sat, 2020-09-26 at 18:29 +0200, Frank Meinl wrote: > Add two paragraphs which list some advantages of multipath and > explain > the benefit for single path devices. The text has been partly > composed > by Benjamin Marzinski. - Refer to >

Re: [dm-devel] [PATCH v2 1/2] libmultipath: Allow discovery of USB devices

2020-09-26 Thread Martin Wilck
On Sat, 2020-09-26 at 18:26 +0200, Frank Meinl wrote: > This change adds a new configuration option allow_usb_devices. It is > disabled by default, so that the behavior of existing setups is not > changed. If enabled (via multipath.conf), USB devices will be found > during device discovery and can

Re: [dm-devel] [PATCH 01/23] multipathd: uxlsnr: avoid deadlock on exit

2020-09-26 Thread Martin Wilck
On Fri, 2020-09-25 at 20:52 -0500, Benjamin Marzinski wrote: > > O.k. I'm getting way into the theoretical weeds here, but I believe > that > realloc() is technically allowed to return NULL when it shrinks > allocated memory. In this case num_clients would be too big. Later > in > this function,

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

2020-09-26 Thread Martin Wilck
On Fri, 2020-09-25 at 16:57 -0500, Benjamin Marzinski wrote: > On Fri, Sep 25, 2020 at 10:00:10PM +0200, Martin Wilck wrote: > > > > I suggest to track the verbosity independently in a different > > variable, > > and just set it from init_config() if it was actually

Re: [dm-devel] [PATCH v2 17/21] libmultipath: add udev and logsink symbols

2020-09-25 Thread Martin Wilck
On Fri, 2020-09-25 at 18:03 -0500, Benjamin Marzinski wrote: > > I don't understand why we need both _udev_init() and > _libmultipath_init(). Just in case we need more initialization in the future, then we could add _foo_init(). Not important of course, I can change it back. Cheers, Martin

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

2020-09-25 Thread Martin Wilck
On Thu, 2020-09-24 at 23:34 -0500, Benjamin Marzinski wrote: > > This causes problems with the libmpathvalid library code I > wrote. The > issue is that right now, when you run _init_config() if > get_multipath_config() returns NULL, you will use the default > loglevel. > I would like the

Re: [dm-devel] [PATCH 00/11] multipath-tools: add linker version scripts

2020-09-25 Thread Martin Wilck
On Thu, 2020-09-24 at 21:09 -0500, Benjamin Marzinski wrote: > > Reviewed-by: Benjamin Marzinski > For this patchset, except for 0002 and 0008 Thanks a lot. I've fixes for both, will resubmit as soon as we have consensus about the ABI version numbering. Martin -- dm-devel mailing list

Re: [dm-devel] [PATCH 10/11] libmpathpersist: add linker version script

2020-09-25 Thread Martin Wilck
On Thu, 2020-09-24 at 23:00 -0500, Benjamin Marzinski wrote: > On Thu, Sep 24, 2020 at 03:36:43PM +0200, mwi...@suse.com wrote: > > > > --- /dev/null > > +++ b/libmpathpersist/libmpathpersist.version > > @@ -0,0 +1,20 @@ > > +LIBMPATHPERSIST_0.8.4.0 { > > I have a question about this version. Do

Re: [dm-devel] [PATCH 02/11] libmultipath: copy mpp->hwe from pp->hwe

2020-09-25 Thread Martin Wilck
On Thu, 2020-09-24 at 15:12 -0500, Benjamin Marzinski wrote: > On Thu, Sep 24, 2020 at 03:36:35PM +0200, mwi...@suse.com wrote: > > From: Martin Wilck > > > > Since f0462f0 ("libmultipath: use vector for for pp->hwe and mp- > > >hwe"), > > we've

Re: [dm-devel] [RFC PATCH v2 0/3] add library to check if device is a valid path

2020-09-25 Thread Martin Wilck
On Thu, 2020-09-24 at 20:08 -0500, Benjamin Marzinski wrote: > On Thu, Sep 24, 2020 at 07:22:21PM +0000, Martin Wilck wrote: > > > > So, SID will call into libmultipath via libmpathvalid, udev will > > obtain > > the properties from SID, and multipathd will fetch the

Re: [dm-devel] [PATCH 23/23] multipath-tools: mpath-tools.supp: file with valgrind suppressions

2020-09-25 Thread Martin Wilck
On Thu, 2020-09-24 at 15:58 -0500, Benjamin Marzinski wrote: > On Thu, Sep 24, 2020 at 03:40:54PM +0200, mwi...@suse.com wrote: > > From: Martin Wilck > > > > Git complains about the extra blank line at the end of the file I'm sorry. At least this one will be easy to fi

Re: [dm-devel] [RFC PATCH v2 0/3] add library to check if device is a valid path

2020-09-24 Thread Martin Wilck
On Thu, 2020-09-24 at 11:30 -0500, Benjamin Marzinski wrote: > On Thu, Sep 24, 2020 at 08:18:02AM +0000, Martin Wilck wrote: > > On Wed, 2020-09-23 at 23:59 -0500, Benjamin Marzinski wrote: > > > > > > The second patch adds get_uid fallback code for dasd devices. The &

Re: [dm-devel] [RFC PATCH v2 3/3] libmultipath: change log level for null uid_attribute

2020-09-24 Thread Martin Wilck
On Thu, 2020-09-24 at 11:20 -0500, Benjamin Marzinski wrote: > On Thu, Sep 24, 2020 at 08:06:41AM +0000, Martin Wilck wrote: > > On Wed, 2020-09-23 at 23:59 -0500, Benjamin Marzinski wrote: > > > > > > diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c >

Re: [dm-devel] [RFC PATCH v2 0/3] add library to check if device is a valid path

2020-09-24 Thread Martin Wilck
verrides like this at runtime, modifying the configuration. Perhaps we could support an application-specific, additional config_dir, from which items like the above could be read in addition to the regular configuration files. This additional configuration would not be used by multipathd and multipath. Does

Re: [dm-devel] [RFC PATCH v2 3/3] libmultipath: change log level for null uid_attribute

2020-09-24 Thread Martin Wilck
p; allow_fallback)) && has_uid_fallback(pp)) { if (!empty_uid_attr) used_fallback = 1; len = uid_fallback(pp, path_state, ); Regards, Martin -- Dr. Martin Wilck , Tel. +49 (0)911 74053 2107 SUSE Software Solutions Germany GmbH HRB 36809, AG Nürnberg GF: Felix Imendörffer -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

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

2020-09-23 Thread Martin Wilck
On Mon, 2020-09-21 at 15:10 -0500, Benjamin Marzinski wrote: > > After calling libmultipath_exit(), you can never reinitialized the > udev > device. That seems fine, but it should probably set udev to null, so > that future calls to libmultipath_init() don't return success. Either > that or

Re: [dm-devel] [PATCH] libmultipath: Allow discovery of USB devices

2020-09-22 Thread Martin Wilck
On Tue, 2020-09-22 at 17:27 -0500, Benjamin Marzinski wrote: > On Tue, Sep 22, 2020 at 09:59:36PM +0200, Martin Wilck wrote: > > On Tue, 2020-09-22 at 20:34 +0200, Frank Meinl wrote: > > > This change adds a new configuration option allow_usb_devices. It > > > is &g

Re: [dm-devel] [PATCH] libmultipath: Allow discovery of USB devices

2020-09-22 Thread Martin Wilck
On Tue, 2020-09-22 at 20:34 +0200, Frank Meinl wrote: > This change adds a new configuration option allow_usb_devices. It is > disabled by default, so that the behavior of existing setups is not > changed. If enabled (via multipath.conf), USB devices will be found > during device discovery and can

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

2020-09-22 Thread Martin Wilck
On Mon, 2020-09-21 at 15:15 -0500, Benjamin Marzinski wrote: > On Wed, Sep 16, 2020 at 05:37:18PM +0200, mwi...@suse.com wrote: > > From: Martin Wilck > > > > We can use libmultipath's internal symbols now. > > > > Signed-off-by: Martin Wilck >

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

2020-09-21 Thread Martin Wilck
On Mon, 2020-09-21 at 14:08 -0500, Benjamin Marzinski wrote: > > free_config() doesn't actually work for configs that are initialized > by > init_config(). That's fine, but the commit message is wrong. Also, I > wonder if uninit_config() should zero out __internal_config, so that > it's in the

Re: [dm-devel] [PATCH] libmultipath: set mpp->hwe NULL when free_path

2020-09-21 Thread Martin Wilck
On Mon, 2020-09-21 at 19:04 +0800, lixiaokeng wrote: > Here the segfault causes in select_pgfailback again. As show: > > Core was generated by `/sbin/multipathd -d -s'. > Program terminated with signal SIGSEGV, Segmentation fault. > #0 0xa2eb4a20 in select_pgfailback

Re: [dm-devel] [PATCH v2] libmultipath: check udev_device_get_* return value to avoid segfault

2020-09-21 Thread Martin Wilck
invocations of udev_device_get_XYZ() (I suppose you meant something else with "Fix all.", but please be more specific next time then). See path_discover(), declare_sysfs_get_str(), for instance. Anyway, that can be fixed later, so: Reviewed-by: Martin Wilck -- dm-devel mailing list dm-

Re: [dm-devel] [PATCH V6 11/14] mpathpersist: check whether malloc paramp->trnptid_list fails in handle_args func

2020-09-21 Thread Martin Wilck
the issue the other way around, by moving the assignment to num_transportids to after the memset() in alloc_prout_param_descriptor(). But it's not worth forcing you into yet another iteration, so: Reviewed-by: Martin Wilck This means the whole series (except 8/14 which had been taken back) is acked now, and I

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

2020-09-21 Thread Martin Wilck
On Sat, 2020-09-19 at 17:14 -0500, Benjamin Marzinski wrote: > On Wed, Sep 16, 2020 at 05:37:09PM +0200, mwi...@suse.com wrote: > > From: Martin Wilck > > > > As one step towards bundling all possibly racy libdm init calls > > into a single > > functio

Re: [dm-devel] [PATCH 0/6] libmultipath: check udev* func return value

2020-09-18 Thread Martin Wilck
On Fri, 2020-09-18 at 16:39 +0800, lixiaokeng wrote: > >Here we use multipath-tools basing on iscsi. When iscsi logout, > the path > will disappear in sysfs and a uevent will cause. Before uevent > processed, > some coredump will happen but if coredump is solved the multipathd > will > deal

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

2020-09-18 Thread Martin Wilck
On Thu, 2020-09-17 at 18:52 -0500, Benjamin Marzinski wrote: > On Wed, Sep 16, 2020 at 02:18:49PM +0000, Martin Wilck wrote: > > On Tue, 2020-09-15 at 16:45 -0500, Benjamin Marzinski wrote: > > > > > > +struct config; > > > +extern struct config *mpathv

Re: [dm-devel] [PATCH 0/6] libmultipath: check udev* func return value

2020-09-18 Thread Martin Wilck
On Thu, 2020-09-17 at 21:26 -0500, Benjamin Marzinski wrote: > On Tue, Sep 15, 2020 at 12:38:27PM +0800, lixiaokeng wrote: > > Hi, > > The udev* function may return NULL,and it will be > > dereferenced in str* and sscanf func. For example, > > there is a coredump caused in add func, which show

Re: [dm-devel] [PATCH 1/6] libmultipath: check uedv* return value in sysfs_get_host_pci_name

2020-09-18 Thread Martin Wilck
On Tue, 2020-09-15 at 12:39 +0800, lixiaokeng wrote: > udev_device_get_sysname may return NULL. We check the return value. > > Signed-off-by:Lixiaokeng > Signed-off-by: Zhiqiang Liu > Signed-off-by: Linfeilong > --- > libmultipath/discovery.c | 3 +++ > 1 file changed, 3 insertions(+) The

Re: [dm-devel] [PATCH 2/6] libmultipath: check udev* return value in ccw_sysfs_pathinfo

2020-09-18 Thread Martin Wilck
On Tue, 2020-09-15 at 12:39 +0800, lixiaokeng wrote: > We check the return value of udev_device_get_sysname. > > Signed-off-by:Lixiaokeng > Signed-off-by: Zhiqiang Liu > Signed-off-by: Linfeilong > --- > libmultipath/discovery.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git

Re: [dm-devel] [PATCH 5/6] libmultipath: check udev* renturn value in get_ctrl_blkdev

2020-09-18 Thread Martin Wilck
On Tue, 2020-09-15 at 12:41 +0800, lixiaokeng wrote: > We check return value of udev_device_get_devtype before > dereference it. > > Signed-off-by:Lixiaokeng > Signed-off-by: Zhiqiang Liu > Signed-off-by: Linfeilong > --- > libmultipath/foreign/nvme.c | 5 - > 1 file changed, 4

Re: [dm-devel] [PATCH 6/6] libmultipath: check udev* return value in _find_path_by_syspath

2020-09-18 Thread Martin Wilck
On Tue, 2020-09-15 at 12:42 +0800, lixiaokeng wrote: > We check udev_device_get_syspath return value before > dereference it. > > Signed-off-by: Lixiaokeng > Signed-off-by: Zhiqiang Liu > Signed-off-by: Linfeilong > --- > libmultipath/foreign/nvme.c | 5 +++-- > 1 file changed, 3

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

2020-09-16 Thread Martin Wilck
mpt to make this easier for users (meaning less options, less combinations thereof, and less "x supersedes y but only if z is not set" kind of logic). This is not a nack, I just want to understand. Regards Martin -- Dr. Martin Wilck , Tel. +49 (0)911 74053 2107 SUSE Software Solutions Ge

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

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

Re: [dm-devel] [PATCH 0/3] Fixes for bitfield unit tests

2020-09-15 Thread Martin Wilck
On Sat, 2020-08-22 at 00:42 +0200, mwi...@suse.com wrote: > From: Martin Wilck > > Hi Christophe, hi Ben, > > embarassingly, it turns out that my unit test code for the bitfield > code was broken in various ways, which at the same time shows that > I didn't test this as bro

Re: [dm-devel] [PATCH V4 11/14] mpathpersist: check whether malloc paramp->trnptid_list fails in handle_args func

2020-09-11 Thread Martin Wilck
Hi Lixiaokeng, On Fri, 2020-09-11 at 09:34 +0800, lixiaokeng wrote: > > Hi Martin, > When I compile it, I add a patch thats changes int to unsigned int. > But I don't think it is an error. It is just a warning and becomes > an > error with [-Werror]. Anyway, What do you think, why did we add

Re: [dm-devel] [PATCH V4 09/14] libmultipath: check whether mpp->features is NUll in setup_map

2020-09-10 Thread Martin Wilck
On Thu, 2020-09-10 at 18:51 +0800, lixiaokeng wrote: > In assemble_map func, f = STRDUP(mp->features) is just used > for APPEND(). We can directly pass mp->features to APPEND(). > The mpp->features, hwhandler and selector got form strdup > should be check after select* function. > >

Re: [dm-devel] [PATCH V4 14/14] multipathpersist: delete unused variable in handle_args

2020-09-10 Thread Martin Wilck
On Thu, 2020-09-10 at 18:54 +0800, lixiaokeng wrote: > In handle_args, the tmp isn't used. We delete it. > > Signed-off-by: Lixiaokeng > Signed-off-by: Zhiqiang Liu > Signed-off-by: Linfeilong Reviewed-by: Martin Wilck > --- > mpathpersist/main.c | 1 - > 1

Re: [dm-devel] [PATCH V4 11/14] mpathpersist: check whether malloc paramp->trnptid_list fails in handle_args func

2020-09-10 Thread Martin Wilck
On Thu, 2020-09-10 at 18:52 +0800, lixiaokeng wrote: > In handle_args func, we donot check whether malloc paramp and > each paramp->trnptid_list[j] fails before using them, it may > cause access NULL pointer. > > Here, we add alloc_prout_param_descriptor to allocate and init > paramp, and we add

Re: [dm-devel] [PATCH V4 12/14] libmultipathpersist: use update_multipath_table/status, in get_mpvec

2020-09-10 Thread Martin Wilck
f-by: Zhiqiang Liu > Signed-off-by: Linfeilong Reviewed-by: Martin Wilck -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH V4 11/14] mpathpersist: check whether malloc paramp->trnptid_list fails in handle_args func

2020-09-10 Thread Martin Wilck
On Thu, 2020-09-10 at 18:52 +0800, lixiaokeng wrote: > In handle_args func, we donot check whether malloc paramp and > each paramp->trnptid_list[j] fails before using them, it may > cause access NULL pointer. > > Here, we add alloc_prout_param_descriptor to allocate and init > paramp, and we add

Re: [dm-devel] [PATCH V4 09/14] libmultipath: check whether mpp->features is NUll in setup_map

2020-09-10 Thread Martin Wilck
On Thu, 2020-09-10 at 18:51 +0800, lixiaokeng wrote: > In assemble_map func, f = STRDUP(mp->features) is just used > for APPEND(). We can directly pass mp->features to APPEND(). > The mpp->features, hwhandler and selector got form strdup > should be check after select* function. > >

Re: [dm-devel] [PATCH V4 06/14] kpartx: use xmalloc to instead of malloc in main func

2020-09-10 Thread Martin Wilck
On Thu, 2020-09-10 at 18:50 +0800, lixiaokeng wrote: > In main func of kpartx.c, we should check return value of > malloc before using it. So we use xmalloc to instead of > malloc. > > Signed-off-by: Zhiqiang Liu > Signed-off-by: Lixiaokeng Reviewed-by: Martin Wilck -

Re: [dm-devel] [PATCH V4 05/14] multipathd: check return value of malloc in cli_getprkey func

2020-09-10 Thread Martin Wilck
On Thu, 2020-09-10 at 18:49 +0800, lixiaokeng wrote: > In cli_getprkey func, we check the return value of malloc. > > Signed-off-by: Zhiqiang Liu > Signed-off-by: Lixiaokeng > Signed-off-by: Linfeilong Reviewed-by: Martin Wilck -- dm-devel mailing list dm-devel@r

Re: [dm-devel] [PATCH V4 01/14] multipathd: initialize major and minor in cli_add_map

2020-09-10 Thread Martin Wilck
gned-off-by: Zhiqiang Liu > Signed-off-by: Linfeilong Reviewed-by: Martin Wilck -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH V4 02/14] libmultipath: change malloc to calloc in print_foreign_topology

2020-09-10 Thread Martin Wilck
On Thu, 2020-09-10 at 18:47 +0800, lixiaokeng wrote: > We chanege malloc to calloc. > > Signed-off-by: Lixiaokeng > Signed-off-by: Zhiqiang Liu > Signed-off-by: Linfeilong Reviewed-by: Martin Wilck -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mail

Re: [dm-devel] [PATCH V4 04/14] multipathd: check MALLOC return value in mpath_pr_event_handler_fn

2020-09-10 Thread Martin Wilck
ed-off-by: Linfeilong Reviewed-by: Martin Wilck -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH] multipath-tools: add HPE MSA 1060/2060 to hwtable

2020-09-09 Thread Martin Wilck
On Wed, 2020-09-09 at 17:48 +0200, Xose Vazquez Perez wrote: > Cc: Martin Wilck > Cc: Christophe Varoqui > Cc: DM-DEVEL ML > Signed-off-by: Xose Vazquez Perez I'm assuming you have this information from reliable sources. So: Reviewed-by: Martin Wilck > --- > libmulti

Re: [dm-devel] [PATCH 09/14] libmultipath: check whether mp->features is NULl in, assemble_map

2020-09-09 Thread Martin Wilck
On Wed, 2020-09-09 at 11:18 +0800, lixiaokeng wrote: > > On 2020/9/9 0:35, Martin Wilck wrote: > > > > What about this: > > > > assemble_map() is only called from setup_map(), which sets mp- > > >features > > in select_features().

Re: [dm-devel] [PATCH 09/14] libmultipath: check whether mp->features is NULl in, assemble_map

2020-09-08 Thread Martin Wilck
On Tue, 2020-09-08 at 10:45 -0500, Benjamin Marzinski wrote: > On Mon, Sep 07, 2020 at 08:21:28PM +0800, lixiaokeng wrote: > > > > @@ -86,9 +86,12 @@ assemble_map (struct multipath * mp, char * > > > > params, int len) > > > > get_linux_version_code() < KERNEL_VERSION(4, 3, 0)) > > > >

Re: [dm-devel] [PATCH V3 05/14] multipathd: use MALLOC and check return value in cli_getprkey func

2020-09-08 Thread Martin Wilck
On Tue, 2020-09-08 at 16:49 +0800, lixiaokeng wrote: > In cli_getprkey func, we use MALLOC instead of malloc, and check > the return value of MALLOC. > > V1->V2: turn back MALLOC to malloc and reomve error message Ok, but now you need to change the patch subject as well... Also, please don't

Re: [dm-devel] [PATCH V3 06/14] kpartx: check return value of malloc in main func

2020-09-08 Thread Martin Wilck
On Tue, 2020-09-08 at 16:49 +0800, lixiaokeng wrote: > In main func of kpartx.c, we should check return value of > malloc before using it. > > V1->V2: change malloc to xmalloc > > Signed-off-by: Zhiqiang Liu > Signed-off-by: Lixiaokeng > --- > kpartx/kpartx.c | 5 - > 1 file changed, 4

Re: [dm-devel] [PATCH V2 00/14] multipath-tools series: some cleanups and fixes checked by codedex tool

2020-09-08 Thread Martin Wilck
ces). The v1 series you sent was OK, but v2 is different. Regards, Martin > > Changes in V2: > - patch 01: set major and minor to -1 at begining, as suggested > by Martin Wilck > - patch 02: chanege malloc to calloc to calloc, as suggested by > Martin Wilck > - patch 04

Re: [dm-devel] [PATCH V2 00/14] multipath-tools series: some cleanups and fixes checked by codedex tool

2020-09-08 Thread Martin Wilck
On Tue, 2020-09-08 at 14:50 +0800, lixiaokeng wrote: > Patches 01, 02, 04, 05, 06, 09, 11, 12, 14 have some changes. Thanks. What about No. 08? Did you drop it? If yes, please say so. Regards, Martin -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 12/14] libmultipathpersist: use update_multipath_table/status, in get_mpvec

2020-09-07 Thread Martin Wilck
On Fri, 2020-09-04 at 19:05 -0500, Benjamin Marzinski wrote: > On Wed, Sep 02, 2020 at 03:24:33PM +0800, lixiaokeng wrote: > > The return values of dm_get_map, disassemble_map in get_mpvec > > were not checked. Use update_multipath_table/status to instead > > of them. > > > > Looks mostly good.

Re: [dm-devel] [PATCH 00/14] multipath-tools series: some cleanups and fixes checked by codedex tool

2020-09-04 Thread Martin Wilck
On Fri, 2020-09-04 at 15:00 -0500, Benjamin Marzinski wrote: > On Thu, Sep 03, 2020 at 10:08:53PM +0200, Martin Wilck wrote: > > Hello Lixiaokeng, > > > > On Wed, 2020-09-02 at 14:40 +0800, lixiaokeng wrote: > > > Hi: > > > Now, we check multip

Re: [dm-devel] [PATCH 05/14] multipathd: use MALLOC and check return value in, cli_getprkey func

2020-09-04 Thread Martin Wilck
On Fri, 2020-09-04 at 13:25 -0500, Benjamin Marzinski wrote: > On Thu, Sep 03, 2020 at 09:13:04PM +0200, Martin Wilck wrote: > > On Wed, 2020-09-02 at 15:18 +0800, lixiaokeng wrote: > > > In cli_getprkey func, we use MALLOC instead of malloc, and check > > >

Re: [dm-devel] [PATCH 01/14] multipathd: return if dm_get_major_minor failed in, cli_add_map

2020-09-04 Thread Martin Wilck
On Fri, 2020-09-04 at 10:48 +0800, lixiaokeng wrote: > > On 2020/9/4 1:26, Martin Wilck wrote: > > Why not just quit the "do" loop in the error case > > for dm_get_major_minor()? > > > > Martin > > If dm_get_major failed at first time, it will be

Re: [dm-devel] [PATCH 00/14] multipath-tools series: some cleanups and fixes checked by codedex tool

2020-09-03 Thread Martin Wilck
in From fbbca2c5076a489ee4ae643d6d9199ca5085be95 Mon Sep 17 00:00:00 2001 From: Martin Wilck Date: Thu, 3 Sep 2020 22:03:22 +0200 Subject: [PATCH] libmultipath: prototype implementation of log_oom() Rationale: with VERBOSE_OOM_LOGGING, we log the part of the code where OOM occured, with minimal runtime effort (no string f

Re: [dm-devel] [PATCH 06/14] kpartx: check return value of malloc in main func

2020-09-03 Thread Martin Wilck
On Wed, 2020-09-02 at 15:19 +0800, lixiaokeng wrote: > In main func of kpartx.c, we should check return value of > malloc before using it. > > Signed-off-by: Zhiqiang Liu > Signed-off-by: Lixiaokeng > --- > kpartx/kpartx.c | 4 > 1 file changed, 4 insertions(+) > > diff --git

Re: [dm-devel] [PATCH 05/14] multipathd: use MALLOC and check return value in, cli_getprkey func

2020-09-03 Thread Martin Wilck
On Wed, 2020-09-02 at 15:18 +0800, lixiaokeng wrote: > In cli_getprkey func, we use MALLOC instead of malloc, and check > the return value of MALLOC. > > Signed-off-by: Zhiqiang Liu > Signed-off-by: Lixiaokeng > Signed-off-by: Linfeilong > --- > multipathd/cli_handlers.c | 6 +- > 1 file

Re: [dm-devel] [PATCH 04/14] multipathd: check MALLOC return value in, mpath_pr_event_handler_fn

2020-09-03 Thread Martin Wilck
On Wed, 2020-09-02 at 15:17 +0800, lixiaokeng wrote: > In mpath_pr_event_handler_fn, we use MALLOC instead of malloc, and > check > the return value of MALLOC. > > Signed-off-by: Lixiaokeng > Signed-off-by: Zhiqiang Liu > Signed-off-by: Linfeilong > --- > multipathd/main.c | 8 ++-- > 1

Re: [dm-devel] [PATCH 03/14] libmultipath: use map instead of dm_task_get_name

2020-09-03 Thread Martin Wilck
> @@ -1315,7 +1315,7 @@ dm_mapname(int major, int minor) > > map = dm_task_get_name(dmt); > if (map && strlen(map)) > - response = STRDUP((const char *)dm_task_get_name(dmt)); > + response = STRDUP((const char *)map); dm_task_

Re: [dm-devel] [PATCH 02/14] libmultipath: check malloc return value in, print_foreign_topology

2020-09-03 Thread Martin Wilck
On Wed, 2020-09-02 at 15:16 +0800, lixiaokeng wrote: > We check the return value of malloc in print_foreign_topology. > > Signed-off-by: Lixiaokeng > Signed-off-by: Zhiqiang Liu > Signed-off-by: Linfeilong > --- > libmultipath/foreign.c | 4 > 1 file changed, 4 insertions(+) > > diff

Re: [dm-devel] [PATCH 01/14] multipathd: return if dm_get_major_minor failed in, cli_add_map

2020-09-03 Thread Martin Wilck
On Wed, 2020-09-02 at 15:15 +0800, lixiaokeng wrote: > If dm_get_major_minor failed, log with major and minor should not > be printed to avoid major and minor used before initialization. > > Signed-off-by: Lixiaokeng > Signed-off-by: Zhiqiang Liu > Signed-off-by: Linfeilong > --- >

Re: [dm-devel] [PATCH V4 2/5] multipathd: use daemon_status_msg to construct sd notify msg in do_sd_notify func

2020-09-01 Thread Martin Wilck
ggested by Martin. > > Signed-off-by: Zhiqiang Liu > Signed-off-by: lixiaokeng > --- > multipathd/main.c | 33 +++-- > 1 file changed, 11 insertions(+), 22 deletions(-) > Thank you. Reviewed-by: Martin Wilck -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH V3 2/5] multipathd: use daemon_status_msg to construct sd notify msg in do_sd_notify func

2020-09-01 Thread Martin Wilck
procedure a bit and save both of us some work. Would this be ok for you? If yes, please resubmit this as v4. Regards, Martin From 73915fb32b2b0d233ee908a4789613c03c27285e Mon Sep 17 00:00:00 2001 From: Martin Wilck Date: Mon, 31 Aug 2020 11:43:56 +0200 Subject: [PATCH] fixup! multipathd: use

Re: [dm-devel] [PATCH V3 1/5] multipathd: adopt static char* arr in daemon_status

2020-08-31 Thread Martin Wilck
quot;int" as the type of "status" (suggested by Martin) > > Signed-off-by: Zhiqiang Liu > Signed-off-by: lixiaokeng > --- > multipathd/main.c | 32 +--- > multipathd/main.h | 3 ++- > 2 files changed, 19 insertions(+), 16 delet

Re: [dm-devel] [RFC PATCH 4/6] multipathd: cancel threads early during shutdown

2020-08-21 Thread Martin Wilck
On Fri, 2020-08-21 at 17:22 -0500, Benjamin Marzinski wrote: > On Thu, Aug 20, 2020 at 10:39:19PM +0200, Martin Wilck wrote: > > Hi Ben, > > > > I need to get back to this old discussion. I didn't resend this > > patch > > last year, because I tried to figure out

Re: [dm-devel] [PATCH V2 2/5] multipathd: use daemon_status_msg to construct sd notify msg in do_sd_notify func

2020-08-21 Thread Martin Wilck
On Fri, 2020-08-21 at 18:59 +0800, Zhiqiang Liu wrote: > sd_notify_status() is very similar with daemon_status(), except > DAEMON_IDLE and DAEMON_RUNNING state. As suggested by Martin, > we can create the sd notification string in a dynamic buffer, > and treat DAEMON_IDLE and DAEMON_RUNNING cases

Re: [dm-devel] [PATCH V2 1/5] multipathd: adopt static char* arr in daemon_status

2020-08-21 Thread Martin Wilck
On Fri, 2020-08-21 at 18:58 +0800, Zhiqiang Liu wrote: > We adopt static char* array (demon_status_msg) in daemon_status func, > so it looks more simpler and easier to expand. > > V1->V2: > - use "int" as the type of "status" (suggested by Martin) > > Signed-off-by: Zhiqiang Liu >

Re: [dm-devel] [PATCH V2 4/5] vector: add lower boundary check in vector_foreach_slot_after

2020-08-21 Thread Martin Wilck
i is illegal before loop (As suggested by Martin) > Reviewed-by: Martin Wilck > Signed-off-by: Zhiqiang Liu > Signed-off-by: lixiaokeng > --- > libmultipath/vector.h | 7 --- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/libmultipath/vector.h b/libmult

Re: [dm-devel] [PATCH V2 5/5] multipathd: remove useless memset after MALLOC in alloc_waiteri func

2020-08-21 Thread Martin Wilck
s suggested by Martin) Reading this, I realize that we don't need alloc_waiter() at all. Anyway: Reviewed-by: Martin Wilck > Signed-off-by: Zhiqiang Liu > Signed-off-by: lixiaokeng > --- > multipathd/waiter.c | 8 +--- > 1 file changed, 1 insertion(+), 7 deletions(-) >

Re: [dm-devel] [PATCH V2 3/5] libmultipath: check blist before calling MALLOC in alloc_ble_device func

2020-08-21 Thread Martin Wilck
> > Signed-off-by: Zhiqiang Liu > Signed-off-by: lixiaokeng > Reviewed-by: Benjamin Marzinski Reviewed-by: Martin Wilck This one is already applied in my "upstream-queue" branch. -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH V2 1/5] multipathd: adopt static char* arr in daemon_status

2020-08-21 Thread Martin Wilck
On Fri, 2020-08-21 at 18:58 +0800, Zhiqiang Liu wrote: > We adopt static char* array (demon_status_msg) in daemon_status func, > so it looks more simpler and easier to expand. > > V1->V2: > - use "int" as the type of "status" (suggested by Martin) >

Re: [dm-devel] [RFC PATCH 4/6] multipathd: cancel threads early during shutdown

2020-08-20 Thread Martin Wilck
Hi Ben, I need to get back to this old discussion. I didn't resend this patch last year, because I tried to figure out how to solve the memory leaks you mentioned. On Thu, 2019-01-17 at 10:59 +0100, Martin Wilck wrote: > On Wed, 2019-01-16 at 17:40 -0600, Benjamin Marzinski wrote: > &g

Re: [dm-devel] [PATCH v3 87/87] libmultipath: fix a -Wformat-truncation warning from gcc 10

2020-08-20 Thread Martin Wilck
On Wed, 2020-08-19 at 17:40 -0500, Benjamin Marzinski wrote: > On Wed, Aug 19, 2020 at 03:18:19PM +0200, mwi...@suse.com wrote: > > From: Martin Wilck > > > > This fixes a warning seen with gcc 10 on x86 (32 bit). > > Fix it by checking the snprintf() return value. &

Re: [dm-devel] [PATCH 3/5] multipathd: add reclear_pp_from_mpp in ev_remove_path

2020-08-20 Thread Martin Wilck
On Thu, 2020-08-20 at 22:51 +0800, lixiaokeng wrote: > Hi Martin: >I test this in 0.8.4 without your patch series . I have review the > code with your patch series and I think this problem will be solved. > But I have another question. > ev_remove_path > ->__setup_multipath >

Re: [dm-devel] [PATCH v3 00/80] multipath-tools series part VI: incomplete udev initialization

2020-08-19 Thread Martin Wilck
On Wed, 2020-08-19 at 15:17 +0200, mwi...@suse.com wrote: > > Changes v2 -> v3, as suggested by Ben Marzinski: > > * 76/80 "libmultipath: select_action(): force udev reload for > uninitialized >maps" >- moved configure.c changes from 77/80 to this patch, where it > belongs > * 77/80

Re: [dm-devel] [PATCH 4/5] multipathd: disable queueing for recreated map in uev_remove_map

2020-08-19 Thread Martin Wilck
dlock actually came to pass. But disabling queuing on a map which can't be in use at the given point in time can't do no harm. So: Reviewed-by: Martin Wilck > --- > multipathd/main.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/multipathd/main.c b/multipathd/main.c > ind

Re: [dm-devel] [PATCH 5/5] libmultipath fix daemon memory leak in disassemble_map

2020-08-19 Thread Martin Wilck
Hello lixiaokeng, Thanks again for your contribution. On Wed, 2020-08-19 at 09:50 +0800, lixiaokeng wrote: > > If checking is_deamon is deleted, there are many other things need be > done like in > https://www.redhat.com/archives/dm-devel/2020-July/msg00245.html. And > this > branch develops

Re: [dm-devel] [PATCH 4/5] multipathd: disable queueing for recreated map in uev_remove_map

2020-08-18 Thread Martin Wilck
Hi Lixiaokeng, On Tue, 2020-08-18 at 21:09 +0800, lixiaokeng wrote: > There may be a race window here: > 1. all paths gone, causing map flushed both from multipathd and > kernel > 2. paths regenerated, causing multipathd creating the map again. > > 1 will generate a remove uevent which can be

Re: [dm-devel] [PATCH 3/5] multipathd: add reclear_pp_from_mpp in ev_remove_path

2020-08-18 Thread Martin Wilck
On Tue, 2020-08-18 at 21:08 +0800, lixiaokeng wrote: > Add reclear_pp_from_mpp in ev_remove_path to make sure that pp is > cleared in mpp. > > When multipathd del path xxx, multipathd -v2, multipathd add path xxx > and multipath -U > dm-x are executed simultaneously, multipath -U dm-x will case >

Re: [dm-devel] [PATCH 2/5] libmultipath fix NULL dereference in select_action

2020-08-18 Thread Martin Wilck
On Tue, 2020-08-18 at 21:06 +0800, lixiaokeng wrote: > I got a multipath segfault while running iscsi login/logout and > following scripts in parallel: > > #!/bin/bash > interval=1 > while true > do > multipath -F &> /dev/null > multipath -r &> /dev/null >

Re: [dm-devel] [PATCH 1/5 v4] libmultipath fix a memory leak in set_ble_device

2020-08-18 Thread Martin Wilck
; > The type of ble->vendor_reg is regex_t struct but not a > pointer, so it can not be set NULL. Ups. Right. Thanks for correcting me. > > Signed-off-by: Lixiaokeng > Signed-off-by: Zhiqiang Liu Reviewed-by: Martin Wilck -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH 3/6] multipathd: adopt static char* arr in sd_notify_status func

2020-08-18 Thread Martin Wilck
On Mon, 2020-08-17 at 23:33 +0800, Zhiqiang Liu wrote: > > On 2020/8/17 16:35, Martin Wilck wrote: > > On Sun, 2020-08-16 at 09:44 +0800, Zhiqiang Liu wrote: > > > We adopt static char* array (sd_notify_status_msg) in > > > sd_notify_status func, so it

Re: [dm-devel] [PATCH 3/6] multipathd: adopt static char* arr in sd_notify_status func

2020-08-18 Thread Martin Wilck
On Sun, 2020-08-16 at 09:44 +0800, Zhiqiang Liu wrote: > We adopt static char* array (sd_notify_status_msg) in > sd_notify_status func, so it looks more simpler and easier > to expand. > > Signed-off-by: Zhiqiang Liu > Signed-off-by: lixiaokeng > --- > multipathd/main.c | 26

Re: [dm-devel] [PATCH v2 84/84] libmultipath: add consistency check for alias settings

2020-08-18 Thread Martin Wilck
On Mon, 2020-08-17 at 19:30 -0500, Benjamin Marzinski wrote: > On Wed, Aug 12, 2020 at 01:36:01PM +0200, mwi...@suse.com wrote: > > From: Martin Wilck > > > > A typo in a config file, assigning the same alias to multiple > > WWIDs, > > can cause massive confusio

Re: [dm-devel] [PATCH v2 76/80] libmultipath: select_action(): force udev reload for uninitialized maps

2020-08-18 Thread Martin Wilck
On Mon, 2020-08-17 at 16:31 -0500, Benjamin Marzinski wrote: > On Wed, Aug 12, 2020 at 01:35:40PM +0200, mwi...@suse.com wrote: > > From: Martin Wilck > > > > If we are in the reconfigure() code path, and we encounter maps to > > be reloaded, we usually set the D

Re: [dm-devel] [PATCH 1/6] checker: remove useless name check in checker_get func

2020-08-17 Thread Martin Wilck
On Mon, 2020-08-17 at 23:12 +0800, Zhiqiang Liu wrote: > On 2020/8/17 16:05, Martin Wilck wrote: > > On Sun, 2020-08-16 at 09:42 +0800, Zhiqiang Liu wrote: > > > In checker_get func, input name will be checked before > > > calling checker_class_lookup func, in which name

Re: [dm-devel] [PATCH 6/6] multipathd: return NULL if MALLOC fails in alloc_waiteri, func

2020-08-17 Thread Martin Wilck
On Sun, 2020-08-16 at 09:46 +0800, Zhiqiang Liu wrote: > In alloc_waiter func, if MALLOC fails, wp is equal to NULL. > If now we call memset(wp), segmentation fault will occur. > > Signed-off-by: Zhiqiang Liu > Signed-off-by: lixiaokeng > --- > multipathd/waiter.c | 4 +++- > 1 file changed, 3

Re: [dm-devel] [PATCH 5/6] vector: add lower boundary check in vector_foreach_slot_after

2020-08-17 Thread Martin Wilck
On Sun, 2020-08-16 at 09:45 +0800, Zhiqiang Liu wrote: > In vector_foreach_slot_after macro, i is the input var, which > may have a illegal value (i < 0). So we should add lower boundary > check in vector_foreach_slot_after macro. > > Signed-off-by: Zhiqiang Liu > Signed-off-by: lixiaokeng >

Re: [dm-devel] [PATCH 4/6] libmultipath: check blist before calling MALLOC in alloc_ble_device func

2020-08-17 Thread Martin Wilck
On Sun, 2020-08-16 at 09:45 +0800, Zhiqiang Liu wrote: > In alloc_ble_device func, ble is firstly allocated by calling MALLOC, > and then input blist is checked whether it is valid. If blist is not > valid, ble will be freed without using. > > Here, we should check blist firstly. > >

Re: [dm-devel] [PATCH v2 41/42] libmultipath: refuse reloading an existing map with different WWID

2020-08-14 Thread Martin Wilck
On Fri, 2020-08-14 at 09:48 +0200, Martin Wilck wrote: > Hi Ben, > > On Thu, 2020-08-13 at 17:23 -0500, Benjamin Marzinski wrote: > > > > I'm > > also open to convinced that it would be o.k. to rename a device > > that > > we > > weren't planing on r

Re: [dm-devel] [PATCH v2 41/42] libmultipath: refuse reloading an existing map with different WWID

2020-08-14 Thread Martin Wilck
Hi Ben, On Thu, 2020-08-13 at 17:23 -0500, Benjamin Marzinski wrote: > On Wed, Aug 12, 2020 at 01:34:05PM +0200, mwi...@suse.com wrote: > > From: Martin Wilck > > > > If a map with given name (alias) already exists with a different > > WWID, > > reload

Re: [dm-devel] [PATCH V3] libmultipath: fix a memory leak in set_ble_device

2020-08-13 Thread Martin Wilck
> Signed-off-by: Lixiaokeng > Signed-off-by: Zhiqiang Liu Thank you. Reviewed-by: Martin Wilck -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH v2 0/8] multipath cleanups

2020-08-12 Thread Martin Wilck
previous > patchset. > > Changes in v2: > - patch 0003 no longer refactors count_active_paths(), as suggested > by Martin Wilck > - Added patches 0007 & 0008, which are both unrelated minor changes. > > Benjamin Marzinski (8): > Makefile.inc: trim extra information f

Re: [dm-devel] [PATCH v2 7/8] multipathd: unset mpp->hwe when removing map

2020-08-12 Thread Martin Wilck
; condlog(2, "%s: map flushed", mpp->alias); > } > > + mpp->hwe = NULL; > orphan_paths(vecs->pathvec, mpp, "map flushed"); > remove_map_and_stop_waiter(mpp, vecs); > -- Dr. Martin Wilck , Tel. +49 (0)911 74053 2107 SUSE Software Solutions Germany GmbH HRB 36809, AG Nürnberg GF: Felix Imendörffer -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

Re: [dm-devel] [PATCH V3] vector: return false if realloc fails in vector_alloc_slot func

2020-08-12 Thread Martin Wilck
the new allocated slot, and use it by calling > vector_set_slot func. Finally, the data of last slot is lost. > > Here, we rewrite vector_alloc_slot as suggested by Martin Wilck: > - increment v->allocated only after successful allocation, > - avoid the "if (v->slot)"

<    1   2   3   4   5   6   7   8   9   10   >