[dm-devel] [PATCH 10/12] libmultipath: filter uevents before proccessing

2016-12-27 Thread tang . junhui
From: tang.junhui Before merging uevents, these uevents are going to be filtered: Change or addition uevent of a removed path (it indicate by an deletion uevent occurred later). Change-Id: If00c2c2e23ea466c1d4643c541ed2d8f9a0c8dea Signed-off-by: tang.junhui --- libmultipath/uevent.c | 55 +

[dm-devel] [PATCH 03/12] libmultipath: add two list iteration macros

2016-12-27 Thread tang . junhui
From: tang.junhui Add two list iteration macros, they are used to iterate list forwards or backwards from the given begin node to the given end node, which would be used in merging uevents. Change-Id: I8bb53fef9276bb62a5e0f4fdac6455086dc03d9b Signed-off-by: tang.junhui --- libmultipath/list.h

[dm-devel] [PATCH 01/12] libmultipath: add wwid for "struct uevent" to record wwid of uevent

2016-12-27 Thread tang . junhui
From: tang.junhui Add "char *wwid" to point WWID of uevent. This member identifies the LUN ID which the path belongs to, and it is used for merging uevents. WWID possibly did not exist in uevent yet, so ->wwid would be NULL, those uevents would not be merged, but be proccessed as old way. Change

[dm-devel] [PATCH 05/12] multipathd: add need_do_map to indicate whether need calling domap() in ev_remove_path()

2016-12-27 Thread tang . junhui
From: tang.junhui Usually calling domap() in ev_remove_path() is needed, but only last path need to call domap() in processing for merged uevents to reduce the count of calling domap() and promote efficiency. So add input parameter need_do_map to indicate whether need calling domap() in ev_remove

[dm-devel] [PATCH 07/12] multipathd: move calling filter_devnode() from uev_trigger() to uevent_can_discard()

2016-12-27 Thread tang . junhui
From: tang.junhui Move calling filter_devnode() from uev_trigger() to uevent_can_discard() since they do the similar work. Change-Id: I0322443fa551b21aa3211bf1ce3fad7d37aeeab4 Signed-off-by: tang.junhui --- libmultipath/uevent.c | 25 +++-- multipathd/main.c | 9 --

[dm-devel] [PATCH 06/12] multipathd: move uev_discard() to uevent.c and change its name to uevent_can_discard()

2016-12-27 Thread tang . junhui
From: tang.junhui Move uev_discard() form uevent processing thread to uevent listening thread to discard unnecessary uevents as soon as possible. Change-Id: Iaac159ffe3930e53c3325d1069c3ed497e440c0c Signed-off-by: tang.wenjun --- libmultipath/uevent.c | 28 multipa

[dm-devel] [PATCH 12/12] libmultipath: use existing wwid when wwid has already been existed in uevent

2016-12-27 Thread tang . junhui
From: tang.junhui Use existing wwid when wwid has already been existed in uevent, it avoids to get wwid again in pathinfo(), and reduces the count of calling getuid(), which would promote processing efficiency. Change-Id: Ia0c7273d33a220e5b415ec42d6b72660018cf4d9 Signed-off-by: tang.junhui ---

[dm-devel] [PATCH 02/12] libmultipath: add merge_node for "struct uevent" to record nodes of merged uevents

2016-12-27 Thread tang . junhui
From: tang.junhui Add merged nodes list to store nodes of merged uevents. By Adding this member, after merging, the list of uevents would be linked like this: uevent --- |struct list_head node |->list node of un-merged uevents --- |struct

[dm-devel] [PATCH 11/12] multipathd: proccess merged uevents

2016-12-27 Thread tang . junhui
From: "tang.junhui" After filtering and merging, then uevents are processed in uev_trigger(), firstly, each of merged uevents would be processed one by one with need_do_map in value of 0. Finally, the node “uev” itself would be processed with need_do_map in value of 1, which would reload kernel t

[dm-devel] [PATCH 09/12] multipathd: merge uevents before proccessing

2016-12-27 Thread tang . junhui
From: tang.junhui These uevents are going to be merged: 1) uevents come from paths and 2) uevents type is same and 3) uevents type is addition or deletion and 4) uevents wwid is same. Change-Id: I05ee057391c092aa0c5f989b7a4f9cb550bb4d98 Signed-off-by: tang.junhui --- libmultipath/uevent.c | 12

[dm-devel] [PATCH 04/12] multipathd: add need_do_map to indicate whether need calling domap() in ev_add_path()

2016-12-27 Thread tang . junhui
From: tang.junhui Usually calling domap() in ev_add_path() is needed, but only last path need to call domap() in processing for merged uevents to reduce the count of calling domap() and promote efficiency. So add input parameter need_do_map to indicate whether need calling domap() in ev_add_path(

[dm-devel] [PATCH 00/12] multipath-tools: improve processing efficiency for addition and deletion of multipath devices

2016-12-27 Thread tang . junhui
ment will be welcome, and it would be appreciated if these patches would be considered for inclusion in the upstream multipath-tools. Thank you all, Tang Junhui -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel

[dm-devel] [PATCH 08/12] libmultipath: wait one seconds for more uevents in uevent_listen() in uevents burst situations

2016-12-27 Thread tang . junhui
From: tang.junhui The more uevents are merged, the higher efficiency program will performs. So, do not process uevents after receiving immediately in uevents burst situations, but continue wait 1 seconds for more uevents except that too much uevents (2048) have already been received or too much t

Re: [dm-devel] [PATCH 08/12] libmultipath: wait one seconds for more uevents in uevent_listen() in uevents burst situations

2016-12-28 Thread tang . junhui
Hi Martin, Thank you for your respond, I will modify it and resend it later. Regards, Tang 发件人: Martin Wilck 收件人: tang.jun...@zte.com.cn, christophe.varo...@opensvc.com, h...@suse.de, bmarz...@redhat.com, bart.vanass...@sandisk.com, 抄送: dm-devel@redhat.com, zhang.ka...@zte

[dm-devel] [PATCH 08/12] libmultipath: wait one seconds for more uevents in uevent_listen() in uevents burst situations

2016-12-28 Thread tang . junhui
From: tang.junhui The more uevents are merged, the higher efficiency program will performs. So, do not process uevents after receiving immediately in uevents burst situations, but continue wait one seconds for more uevents except that too much uevents (2048) have already been received or too much

[dm-devel] [PATCH] multipathd: fix SIGUSR2 handling

2016-12-29 Thread tang . junhui
From: "tang.junhui" SIGUSR2 is not blocked by default, it would cause bellow conflict in removing of the last path: - uevent processing thread | waiter thread -|---

Re: [dm-devel] [PATCH 11/12] multipathd: proccess merged uevents

2017-01-03 Thread tang . junhui
Hello Ben Good idea, I will modify the patch to filter these change uevents. Thanks Tang Junhui 发件人: "Benjamin Marzinski" 收件人: tang.jun...@zte.com.cn, 抄送: tang.wenj...@zte.com.cn, zhang.ka...@zte.com.cn, dm-devel@redhat.com, bart.vanass...@sandisk.com, mwi...@s

Re: [dm-devel] [PATCH 10/12] libmultipath: filter uevents before proccessing

2017-01-03 Thread tang . junhui
Hello Ben, I add wwid judgment for safe. I think twice, and as you say, it is safe enough without this judgment, I will delete these wwid judgment. Tanks Tang Junhui 发件人: "Benjamin Marzinski" 收件人: tang.jun...@zte.com.cn, 抄送: tang.wenj...@zte.com.cn, zhang.ka...@

Re: [dm-devel] [PATCH 09/12] multipathd: merge uevents before proccessing

2017-01-03 Thread tang . junhui
Hello Ben, Yes, a *_safe list traversal method can meet the needs, I will modify it and simplify the codes. Thanks, Tang Junhui 发件人: "Benjamin Marzinski" 收件人: tang.jun...@zte.com.cn, 抄送: tang.wenj...@zte.com.cn, zhang.ka...@zte.com.cn, dm-devel@redhat.com, b

Re: [dm-devel] [PATCH 01/12] libmultipath: add wwid for "struct uevent" to record wwid of uevent

2017-01-03 Thread tang . junhui
bd divice for uevents merging, these device process as old way, it has no harm in logic. If we need to merge rbd uevents for these devices, we can add code to get wwid from uevents and it can be supported easily. Regards Tang Junhui 发件人: "Benjamin Marzinski" 收件人:

Re: [dm-devel] [PATCH 08/12] libmultipath: wait one seconds for more uevents in uevent_listen() in uevents burst situations

2017-01-03 Thread tang . junhui
still stick to it, I will revert it to uevents processing thread, and call it in uevent_dispatch() before calling merge_uevq(), actually, I'm going to do that. Regards Tang Junhui 发件人: "Benjamin Marzinski" 收件人: tang.jun...@zte.com.cn, 抄送: tang.wenj...@

Re: [dm-devel] [PATCH 01/12] libmultipath: add wwid for "struct uevent" to record wwid of uevent

2017-01-04 Thread tang . junhui
e >like rbd uses. I think it is ok, but a little complex. and if we can get rid of the "wwid" issue, we do not need to do so. Regards Tang Junhui 发件人: "Benjamin Marzinski" 收件人: tang.jun...@zte.com.cn, 抄送: tang.wenj...@zte.com.cn, zhang.ka...@zte.co

Re: [dm-devel] [PATCH 01/12] libmultipath: add wwid for "struct uevent" to record wwid of uevent

2017-01-05 Thread tang . junhui
ading statement in previous email). "merge_id" and "wwid" can be same or not same. The merged uevents are still processed as bellow patch I send previous: [dm-devel] [PATCH 11/12] multipathd: proccess merged uevents Regards, Tang Junhui 发件人: "Benjamin Marzins

Re: [dm-devel] [PATCH 01/12] libmultipath: add wwid for "struct uevent" to record wwid of uevent

2017-01-08 Thread tang . junhui
Hello Ben, OK, I will modify code to call domap() on the device if its wwid is different from its merge_id. I'll resend a serials of patch later, Thank you for your patience. Regards, Tang Junhui 发件人: "Benjamin Marzinski" 收件人: tang.jun...@zte.com.cn,

[dm-devel] [PATCH 05/11] multipathd: add need_do_map to indicate whether need calling domap() in ev_remove_path()

2017-01-11 Thread tang . junhui
From: tang.junhui Usually calling domap() in ev_remove_path() is needed, but only last path need to call domap() in processing for merged uevents to reduce the count of calling domap() and promote efficiency. So add input parameter need_do_map to indicate whether need calling domap() in ev_remove

[dm-devel] [PATCH 02/11] libmultipath: add merge_node for "struct uevent" to record nodes of merged uevents

2017-01-11 Thread tang . junhui
From: tang.junhui Add merged nodes list to store nodes of merged uevents. By Adding this member, after merging, the list of uevents would be linked like this: uevent --- |struct list_head node |->list node of un-merged uevents --- |struct

[dm-devel] [PATCH 11/11] multipathd: proccess merged uevents

2017-01-11 Thread tang . junhui
From: "tang.junhui" After filtering and merging, then uevents are processed in uev_trigger(), firstly, each of merged uevents would be processed one by one with need_do_map in value of 0. Finally, the node “uev” itself would be processed with need_do_map in value of 1, which would reload kernel t

[dm-devel] [PATCH 07/11] multipathd: move calling filter_devnode() from uev_trigger() to uevent_can_discard()

2017-01-11 Thread tang . junhui
From: tang.junhui Move calling filter_devnode() from uev_trigger() to uevent_can_discard() since they do the similar work. Change-Id: I0322443fa551b21aa3211bf1ce3fad7d37aeeab4 Signed-off-by: tang.junhui --- libmultipath/uevent.c | 20 multipathd/main.c | 9 -

[dm-devel] [PATCH 10/11] libmultipath: filter uevents before proccessing

2017-01-11 Thread tang . junhui
From: tang.junhui Before merging uevents, these uevents are going to be filtered: 1) Change or addition uevent of a removed path (it indicate by an deletion uevent occurred later), and 2) Change uevent if addition uevent of a path has not ever been proccessed. Change-Id: If00c2c2e23ea466c1d4643c

[dm-devel] [PATCH 09/11] multipathd: merge uevents before proccessing

2017-01-11 Thread tang . junhui
From: tang.junhui These uevents are going to be merged: 1) uevents come from paths and 2) uevents type is same and 3) uevents type is addition or deletion and 4) uevents merge_id is same. Change-Id: I05ee057391c092aa0c5f989b7a4f9cb550bb4d98 Signed-off-by: tang.junhui --- libmultipath/uevent.c

[dm-devel] [PATCH 08/11] libmultipath: wait one seconds for more uevents in uevent_listen() in uevents burst situations

2017-01-11 Thread tang . junhui
From: tang.junhui The more uevents are merged, the higher efficiency program will performs. So, do not process uevents after receiving immediately in uevents burst situations, but continue wait one seconds for more uevents except that too much uevents (2048) have already been received or too much

[dm-devel] [PATCH 04/11] multipathd: add need_do_map to indicate whether need calling domap() in ev_add_path()

2017-01-11 Thread tang . junhui
From: tang.junhui Usually calling domap() in ev_add_path() is needed, but only last path need to call domap() in processing for merged uevents to reduce the count of calling domap() and promote efficiency. So add input parameter need_do_map to indicate whether need calling domap() in ev_add_path(

[dm-devel] [PATCH 06/11] multipathd: move uev_discard() to uevent.c and change its name to uevent_can_discard()

2017-01-11 Thread tang . junhui
From: tang.junhui This patch is mainly done to adjust the code for the preparation of uevents merging. Change-Id: Iaac159ffe3930e53c3325d1069c3ed497e440c0c Signed-off-by: tang.wenjun --- libmultipath/uevent.c | 40 multipathd/main.c | 25 ---

[dm-devel] [PATCH 00/11] multipath-tools: improve processing efficiency for addition and deletion of multipath devices

2017-01-11 Thread tang . junhui
merged uevents --[patch]libmultipath: add three list iteration macros Any comment will be welcome, and it would be appreciated if these patches would be considered for inclusion in the upstream multipath-tools. Thank you all, Tang Junhui -- dm-devel mailing list dm-devel@redhat.com https

[dm-devel] [PATCH 03/11] libmultipath: add three list iteration macros

2017-01-11 Thread tang . junhui
From: tang.junhui Add three list iteration macros, list_for_each_entry_reverse_safe is used for safe list iteration, and the other two macros are used to iterate list forwards or backwards from the given begin node to the given end node, which would be used in merging uevents. Change-Id: I8bb53f

[dm-devel] [PATCH 01/11] libmultipath: add merge_id in "struct uevent" for uevents merging

2017-01-11 Thread tang . junhui
From: tang.junhui merge_id is used for uevents merging, it is expected to be same with wwid, uevents with the same merge_id will be merged, and if it is same with wwid, only the last uevent will call domap(). now we only merge uevents with label ID_SERIAL or ID_UID in uevent, which usually commin

Re: [dm-devel] [LSF/MM TOPIC][LSF/MM ATTEND] multipath redesign

2017-01-16 Thread tang . junhui
asy to use multipath. Thank you Tang Junhui 发件人: Hannes Reinecke 收件人: Mike Snitzer , 抄送: "linux-bl...@vger.kernel.org" , "lsf...@lists.linux-foundation.org" , device-mapper development , "linux-s...@vger.kernel.org" 日期: 2017/01/14 01:52 主题: Re:

Re: [dm-devel] [PATCH 04/11] multipathd: add need_do_map to indicate whether need calling domap() in ev_add_path()

2017-01-16 Thread tang . junhui
no merging works. Please confirm whether this modification is feasible. Regards, Tang Junhui 发件人: "Benjamin Marzinski" 收件人: tang.jun...@zte.com.cn, 抄送: christophe.varo...@opensvc.com, h...@suse.de, mwi...@suse.com, bart.vanass...@sandisk.com, dm-devel@redhat.co

[dm-devel] [PATCH] multipath-tools: improve processing efficiency for addition and deletion of multipath devices

2017-01-17 Thread tang . junhui
multipath-tools. Thank you all, Tang Junhui --- libmultipath/config.c | 3 + libmultipath/config.h | 1 + libmultipath/dict.c| 3 + libmultipath/discovery.c | 5 +- libmultipath/discovery.h | 2 +- libmultipath/list.h| 41 ++ libmultipath/propsel.c |

[dm-devel] [PATCH] multipath-tools: improve processing efficiency for addition and deletion of multipath devices

2017-02-15 Thread tang . junhui
From: "tang.junhui" Change-Id: I3f81a55fff389f991f915927000b281d7e263cc5 Signed-off-by: tang.junhui This patch used to improve processing efficiency for addition and deletion of multipath devices. This patch is tested pass by ZTE multipath automatic testing system. The modification reduces the

[dm-devel] [PATCH] multipath-tools: improve processing efficiency for addition and deletion of multipath devices

2017-02-27 Thread tang . junhui
From: "tang.junhui" This patch used to improve processing efficiency for addition and deletion of multipath devices. This patch is tested pass by ZTE multipath automatic testing system. The modification reduces the system consumption(such as CPU) and shortens the processing time obviously in sce

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

2016-07-03 Thread tang . junhui
TOR_SIZE(vecs->pathvec)) free_pathvec(vecs->pathvec, FREE_PATHS); * Then the vecs->pathvec is set to NULL, so the vector memory which vecs->pathvec pointed to is leaked: vecs->pathvec = NULL; Please review the solutions to the problem in the attachment: 唐军

[dm-devel] [PATCH] multipathd: fix memory leak in reconfigure()

2016-07-18 Thread tang . junhui
From: "tang.junhui" Problem: Memory leak exists in reconfigure() when multipathd command reconfigure is executed. Reasons: * The following judgment condition is not satisfied when there is no path, free_pathvec() is not called to free the vector of vecs->pathvec: if (VECTOR_SIZE(vecs

[dm-devel] [PATCH] multipathd: fail path when path check timeout

2016-08-10 Thread tang . junhui
From: "tang.junhui" path should be failed when path status is PATH_TIMEOUT after check, otherwise, the valid number of paths in the map would be increased when the path status is PATH_UP after the next turn check, which would cause the valid number of paths exceeding the total number of paths in

[dm-devel] [PATCH] multipathd: fix memory allocation logic error for polls in uxsock_listen()

2016-08-10 Thread tang . junhui
From: "tang.junhui" logic error exists in memory allocation for polls in uxsock_listen(), even if the allocated memory size meet the needs, it is still to realloc memory, which is not up to expectations. Signed-off-by: tang.junhui --- multipathd/uxlsnr.c | 8 +--- 1 file changed, 5 inser

[dm-devel] [PATCH] multipathd: fix some small bugs for cli socket

2016-08-11 Thread tang . junhui
From: "tang.junhui" 1) mpath_recv_reply_len() should return error when the length which received by read_all() is wrong; 2) The buffer which *reply point to maybe null when mpath_recv_reply() return with success, so the caller needs to determine whether it is null, and then to use it. Si

[dm-devel] [PATCH] libmultipath: retry to get path serial number by get_serial() after failure by get_vpd_sysfs()

2016-08-11 Thread tang . junhui
From: "tang.junhui" Some operating systems have no such file vpd_pg80 in sys directory such as /sys/devices/platform/host23/session21/target23:0:0/23:0:0:33/, so path serial number would be failed to get by get_vpd_sysfs(), we need retry to get it by get_serial to avoid empty serial of the path.

[dm-devel] [PATCH] libmultipath: fix memory API logic error

2016-08-15 Thread tang . junhui
From: "tang.junhui" Memroy API use mem_allocated to record the total size of used memory, however, it's wrong to use size(p) as the length of freed memory in xfree(), and memory may also be allocated by STRDUP() or REALLOC(), which is not calculated into mem_allocated, so the total size of used m

[dm-devel] 答复: Re: [PATCH] libmultipath: fix memory API logic error

2016-08-15 Thread tang . junhui
Hi, Johannes, Your advice is nice, thank you I will send the modified patch later. 发件人: Johannes Thumshirn 收件人: tang.jun...@zte.com.cn, 抄送: christophe varoqui , zhang.ka...@zte.com.cn, dm-devel@redhat.com 日期: 2016/08/15 21:59 主题: Re: [dm-devel] [PATCH] libmultipath: fix

[dm-devel] [PATCH] libmultipath: fix memory API logic error

2016-08-15 Thread tang . junhui
From: "tang.junhui" Memroy API use mem_allocated to record the total size of used memory, however, it's wrong to use size(p) as the length of freed memory in xfree(), and memory may also be allocated by STRDUP() or REALLOC(), which is not calculated into mem_allocated, so the total size of used m

[dm-devel] [PATCH] libmultipath: fix multipath -q command logic

2016-08-16 Thread tang . junhui
From: "tang.junhui" multipath judged whether multipathd service in running by check_daemon() when executing mutipath commands, check_daemon() try to connect to the multipathd service and execute "show dameon" command. The expected result is that the command will be failed when the service is n

[dm-devel] [PATCH] kpartx: partitions of mapped devices cannot be created in redhat OS

2016-08-29 Thread tang . junhui
From: "tang.junhui" Environment variables such as DM_TABLE_STATE are used in kpartx.rules which exported by "dmsetup export" in previous udev rules in SuSE OS, however, there is no such command "dmsetup export" in redhat OS, so these environment variables are not initialized and partitions ca

[dm-devel] [PATCH] kpartx: partitions of mapped devices cannot be created in redhat OS

2016-08-29 Thread tang . junhui
From: "tang.junhui" Environment variables such as DM_TABLE_STATE are used in kpartx.rules which exported by "dmsetup export" in previous udev rules in SuSE OS, however, there is no such command "dmsetup export" in redhat OS, so these environment variables are not initialized and partitions can

[dm-devel] [PATCH] multipathd: uxsock_timeout should be assigned by conf->uxsock_timeout

2016-09-13 Thread tang . junhui
From: "tang.junhui" uxsock_timeout should be assigned by conf->uxsock_timeout before using it in uxclnt() as a CLI client timeout value, otherwise its default value is 0, and the CLI client timeout value is 0 + 100(ms), so the CLI client will be timeout very quickly. Signed-off-by: tang.junhui

[dm-devel] [PATCH] mpathpersist: memset length is wrong

2016-09-21 Thread tang . junhui
From: "tang.junhui" variable transportids is cleared by memset() with wrong length MPATH_MX_TIDS, the length should be MPATH_MX_TIDS*sizeof(struct transportid). Signed-off-by: tang.junhui --- mpathpersist/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpathpersist/m

Re: [dm-devel] [PATCH 07/15] multipathd: Fix a data race

2016-10-07 Thread tang . junhui
Hello Bart, This patch solved the data race problem, but the assignment for paths check interval has no effect, since there is no path in vecs when calling init_path_check_interval(vecs) in child(), I think it is better to call init_path_check_interval(vecs) at reconfigure() or configure() afte

Re: [dm-devel] [PATCH] mpathpersist: memset length is wrong

2016-10-10 Thread tang . junhui
Please have a review for this patch, any comment will be highly appreciated. 发件人: tang.jun...@zte.com.cn 收件人: christophe varoqui , chau...@redhat.com, Vijay , Benjamin Marzinski , 抄送: zhang.ka...@zte.com.cn, dm-devel@redhat.com, "tang.junhui" 日期: 2016/09/21 16:54 主题:

Re: [dm-devel] [PATCH] multipathd: uxsock_timeout should be assigned by conf->uxsock_timeout

2016-10-10 Thread tang . junhui
Please have a review for this patch, any comment will be highly appreciated. 发件人: tang.jun...@zte.com.cn 收件人: christophe varoqui , 抄送: zhang.ka...@zte.com.cn, dm-devel@redhat.com, "tang.junhui" 日期: 2016/09/13 18:17 主题: [dm-devel] [PATCH] multipathd: uxsock_timeout shou

Re: [dm-devel] [PATCH] libmultipath: fix multipath -q command logic

2016-10-10 Thread tang . junhui
Please have a review for this patch, any comment will be highly appreciated. 发件人: tang.jun...@zte.com.cn 收件人: christophe varoqui , 抄送: dm-devel@redhat.com, zhang.ka...@zte.com.cn, "tang.junhui" 日期: 2016/08/16 19:33 主题: [PATCH] libmultipath: fix multipath -q command log

Re: [dm-devel] [PATCH] multipathd: fail path when path check timeout

2016-10-10 Thread tang . junhui
Please have a review for this patch, any comment will be highly appreciated. 发件人: tang.jun...@zte.com.cn 收件人: christophe varoqui , 抄送: dm-devel@redhat.com, zhang.ka...@zte.com.cn, "tang.junhui" 日期: 2016/08/10 16:11 主题: [PATCH] multipathd: fail path when path check time

Re: [dm-devel] [PATCH] libmultipath: fix multipath -q command logic

2016-10-11 Thread tang . junhui
Hello Hannes, Ben, Could you have a review for this patch, any comment will be highly appreciated. Thanks, Tang 发件人: Christophe Varoqui 收件人: tang.jun...@zte.com.cn, 抄送: Bart Van Assche , device-mapper development , zhang.ka...@zte.com.cn 日期: 2016/10/11 14:59 主题: Re:

Re: [dm-devel] [PATCH 00/15] Fifteen multipath-tools patches

2016-10-11 Thread tang . junhui
Hello Bart, I also think that we do not need init_path_check_interval(), since pp->checkint is initialized in configure() too. Cheers, Tang 发件人: Bart Van Assche 收件人: , , 抄送: bart.vanass...@sandisk.com, dm-devel@redhat.com 日期: 2016/10/11 04:41 主题: Re: [dm-devel] [PATCH

Re: [dm-devel] [PATCH] multipathd: fail path when path check timeout

2016-10-11 Thread tang . junhui
Hello, Ben Thanks for your review, This problem is found by our automatic testing, I will spend more time to correct other similar bugs in the next patch。 Cheers, Tang 发件人: "Benjamin Marzinski" 收件人: tang.jun...@zte.com.cn, 抄送: dm-devel@redhat.com, zhang.ka...@zte.com.cn, b

Re: [dm-devel] [PATCH] libmultipath: fix multipath -q command logic

2016-10-11 Thread tang . junhui
Hello Ben, In multipath manual document, multipath -q command is described as: "-q allow device tables with queue_if_no_path when multiathd is not running". However the command does not take effect when we testing it. About use-case, In my opinion, sometimes we need to stop multipath service

[dm-devel] 答复: Re: [PATCH] libmultipath: fix multipath -q command logic

2016-10-11 Thread tang . junhui
Hello Hannes, check_daemon() now is only used to determine whether to set/remove queue_if_no_path feature for mapped devices, which you said maybe another issue, we are looking forward for your patch. Thanks, Tang 发件人: Hannes Reinecke 收件人: tang.jun...@zte.com.cn, bmarz...@red

[dm-devel] 答复: [RFC] unreleased lock after handler failure

2016-10-12 Thread tang . junhui
Hi, Michael Wang This patch looks well for me, cleanup_lock() should be called without affected by the return value of h->fn(). Regards, Tang 发件人: Michael Wang 收件人: christophe.varo...@opensvc.com, dm-devel@redhat.com, 日期: 2016/10/12 16:11 主题: [dm-devel] [RFC] unreleased l

[dm-devel] [PATCH 1/3] segment faulty occured in dm_get_status()

2016-10-17 Thread tang . junhui
From: "tang.junhui" Signed-off-by: tang.junhui segment faulty occured in dm_get_status(), the call trace is: -- (gdb) bt 0 0x00338ec328a5 in raise () from /lib64/libc.so.6 1 0x00338ec3400d in abort () from /lib64/libc

[dm-devel] [PATCH 3/3] Treat PATH_TIMEOUT as PATH_DOWN

2016-10-17 Thread tang . junhui
From: "tang.junhui" Treat PATH_TIMEOUT as PATH_DOWN since it is basically the same as PATH_DOWN, except with a different state name. So change it to PATH_DOWN immediately if it is PATH_TIMEOUT according to the method in pathinfo(). After the modification all PATH_TIMEOUTs are equal to PATH_DOWN s

[dm-devel] [PATCH 2/3] access vecs memory outside of locking range in check_path()

2016-10-17 Thread tang . junhui
From: "tang.junhui" there are vecs->mpvec memory accesses outside of locking range in check_path(), the judgments is not necessary since the they has existed in vector_foreach_slot(), so delete them. Signed-off-by: tang.junhui --- multipathd/main.c | 45 ++--

[dm-devel] [PATCH] md/dm-table: tgt->type should be putted in dm_table_add_target()

2016-10-20 Thread tang . junhui
From: "tang.junhui" tgt->type should be putted in dm_table_add_target() when the target do not statisfy the needs of target type, otherwise it would cause the module reference count of this target type leakage. Signed-off-by: tang.junhui Cc: sta...@vger.kernel.org --- drivers/md/dm-table.c | 2

Re: [dm-devel] md/dm-table: tgt->type should be putted in dm_table_add_target()

2016-10-20 Thread tang . junhui
Hello, Mike Thanks for your quick respond. This problem causes failure in "rmmod dm-spp" command, (dm-spp is a tagert type for our product) since the reference count is not zero due to the failure of DM table loads. I don't intend to cc stable, I just add the "Cc: sta...@vger.kernel.org" after

[dm-devel] [PATCH] md/dm-mpath: Add NULL pointer check in parse_hw_handler()

2016-10-30 Thread tang . junhui
From: "tang.junhui" m->hw_handler_name value should be checked in parse_hw_handler() after calling kstrdup() to avoid access of NULL pointer. Signed-off-by: tang.junhui --- drivers/md/dm-mpath.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.

Re: [dm-devel] [PATCH] hwe_regmatch: match error

2016-10-31 Thread tang . junhui
Hello Christophe, This issue affects the accuracy of regular matching, and the patch bellow had been reviewed by Hannes, Can you merge it to Opensvc? Thanks Tang On 10/14/2016 04:03 AM, huang.we...@zte.com.cn wrote: > From: "wei.huang" > > Problem: > when we configure a device like vendor, pr

Re: [dm-devel] [PATCH] mpathpersistent: segment faulty occured in mpath_persistent_reserve_in()

2016-10-31 Thread tang . junhui
Hello Hannes, Since this issue is introduced by RCU, can you have a review for this patch? Thanks, Tang 发件人: tang.we...@zte.com.cn 收件人: christophe varoqui , 抄送: zhang.ka...@zte.com.cn, dm-devel@redhat.com, tang.jun...@zte.com.cn, tang.we...@zte.com.cn 日期: 2016/10/27 17

[dm-devel] [PATCH] dm mpath: remove unusable kmultipathd work queue

2016-11-03 Thread tang . junhui
From: "tang.junhui" kmultipathd work queue is used to process queued IOs for multipath target when IOs need to retry, but now these IOs have been requeued to block queue of DM device, hence this work queue is not useful anymore, and this patch deletes it. Signed-off-by: tang.junhui --- drivers

[dm-devel] [PATCH] dm mpath: add check for count of groups to avoid wild pointer access

2016-11-03 Thread tang . junhui
From: "tang.junhui" pg is not assigned to a group address when count of multipath groups is zero in bypass_pg_num(), then it is used in bypass_pg(), which may cause wild pointer access. Signed-off-by: tang.junhui --- drivers/md/dm-mpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [dm-devel] dm mpath: remove unusable kmultipathd work queue

2016-11-03 Thread tang . junhui
Hello Mike, I used the master branch, the code seems a little older, It's true that the newer branches such as dm-4.10 have reused kmultipathd. Thanks, Tang 发件人: Mike Snitzer 收件人: tang.jun...@zte.com.cn, 抄送: zhang.ka...@zte.com.cn, dm-devel@redhat.com, a...@redhat.com 日期:

[dm-devel] 答复: Re: dm mpath: add check for count of groups to avoid wild pointer access

2016-11-03 Thread tang . junhui
Hello Mike, I'm sorry to send you the wrong patch, I'll send a new patch to you later. Thanks Tang 发件人: Mike Snitzer 收件人: tang.jun...@zte.com.cn, 抄送: zhang.ka...@zte.com.cn, dm-devel@redhat.com, a...@redhat.com 日期: 2016/11/03 23:33 主题: Re: [dm-devel] dm mpath: add check

[dm-devel] [PATCH] dm mpath: add check for count of groups to avoid wild pointer access

2016-11-03 Thread tang . junhui
From: "tang.junhui" pg is not assigned to a group address when count of multipath groups is zero in bypass_pg_num(), then it is used in bypass_pg(), which may cause wild pointer access. Signed-off-by: tang.junhui --- drivers/md/dm-mpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[dm-devel] Improve processing efficiency for addition and deletion of multipath devices

2016-11-15 Thread tang . junhui
In these scenarios, multipath processing efficiency is very low: 1) There are many paths in multipath devices, 2) Add/delete devices when iSCSI login/logout or FC link up/down. Multipath process so slowly that it is not satisfied some applications, For example, openstack is often timeout in wait

Re: [dm-devel] Improve processing efficiency for addition and deletion of multipath devices

2016-11-16 Thread tang . junhui
Hello Hannes: Since the received uevent messages store in the queue, and the speed uevent messages received is much faster than the speed uevent messages processed, so, we can merge these queued uevent message first, and then process it in the next step. Of course, some paths ’ uevent messages

Re: [dm-devel] Improve processing efficiency for addition and deletion of multipath devices

2016-11-16 Thread tang . junhui
Hi Martin, Nice to see you, May you success in your team and our open source community. You have put forward a good proposal to queued more uevent messages by kicking uevent processing thread in a predefined time intervals. It is also a good idea to have such intervals configuration. As to

Re: [dm-devel] Improve processing efficiency for addition and deletion of multipath devices

2016-11-17 Thread tang . junhui
Hi Martin, For your opinion: > My "filtering" idea was meant for cases where several events > for the same device are queued, e.g > 1) add sda > 2) change sda > 3) delete sda >Is it always sufficient to look only at the last event in such a case? I do not agree with you. The reasons are a

Re: [dm-devel] Improve processing efficiency for addition and deletion of multipath devices

2016-11-18 Thread tang . junhui
Hi Martin, In your case, my action is: 1) merger uevents 1) 2) to one uevent "add sda sdb", and process them togother 2) process uevent "del sda" 3) process uevent "add sdc" 4) process uevent "del sdb" 5) process uevent "add sda" Though the processing efficiency in such scenario is lower than yo

Re: [dm-devel] Improve processing efficiency for addition and deletion of multipath devices

2016-11-18 Thread tang . junhui
Hi Martin, > This will fail because sdb is non-existent at the time you try - no? Non-existent paths in merger uevents do not affect the entire algorithm. It should be considered at the time of implementation. Your suggestion is meaningful, but I think we need to focus on the existed problem,

Re: [dm-devel] Improve processing efficiency for addition and deletion of multipath devices

2016-11-18 Thread tang . junhui
Hi Martin, 〉But once you start merging, you'd rather be prepared for 〉several events for the same phys device, too. We can base on such a threshold that there is no repeat uevents from the same sd device, otherwise, we pause doing merger, and kick uevent processing thread to process the merged

Re: [dm-devel] Improve processing efficiency for addition and deletion of multipath devices

2016-11-22 Thread tang . junhui
So, now we have at least 4 ways to improve mutliapth efficiency: 1) Filtering uevents; 2) Merger uevents; 3) Using separate locks for mpvec and pathvec; 4) Get rid of the gazillion waiter threads. This is exciting, but how do we achieve this blueprint? Can we set up some working groups and de

[dm-devel] [PATCH 2/2] dm-mpath: Remove useless retain_attached_hw_handler parameter

2016-11-23 Thread tang . junhui
From: "tang.junhui" Hardware handle would be retained no matter parameter retain_attached_hw_handler is set or not in the logic of current code. So remove this useless parameter. Signed-off-by: tang.junhui --- drivers/md/dm-mpath.c | 34 +- 1 file changed, 5 ins

[dm-devel] [PATCH 1/2] dm-mpath: Enable hw_handler_params to take effect if hw_handler is the same between new and old

2016-11-23 Thread tang . junhui
From: "tang.junhui" If the hardware handle which a device has already attached is the same with m->hw_handler_name, m->hw_handler_params should not be ignored, but be enabled to take effect. Signed-off-by: tang.junhui --- drivers/md/dm-mpath.c | 14 +- 1 file changed, 9 insertions(

Re: [dm-devel] Improve processing efficiency for addition and deletion of multipath devices

2016-11-27 Thread tang . junhui
Hello Christophe, Ben, Hannes, Martin, Bart, I am a member of host-side software development team of ZXUSP storage project in ZTE Corporation. Facing the market demand, our team decides to write code to promote multipath efficiency next month. The whole idea is in the mail below.We hope to

Re: [dm-devel] [PATCH 2/2] dm-mpath: Remove useless retain_attached_hw_handler parameter

2016-11-28 Thread tang . junhui
Hello Mike: Thanks for your respond. > 1) in parse_path() you need to always initialize q the condition of q initialization is if (m->retain_attached_hw_handler)” comparing with previous condition if (test_bit(MPATHF_RETAIN_ATTACHED_HW_HANDLER, &m->flags) || m->hw_handler_name) it does not incr

Re: [dm-devel] Improve processing efficiency for addition and deletion of multipath devices

2016-11-29 Thread tang . junhui
Hello Zdenek I think you suggestion is constructive, some unnecessary operations in udev rules waster too much system resoure(CPU etc.) It is another way to promote multipath efficiency, could you put forward more specific amendment? Regards, Tang 发件人: Zdenek Kabelac 收件人: t

Re: [dm-devel] Improve processing efficiency for addition and deletion of multipath devices

2016-11-30 Thread tang . junhui
Hello Ben, Hannes I'm sorry for the late reply. > You can't just get the wwid with no work (look at all work uev_add_path > does, specifically alloc_path_with_pathinfo). Now you could reorder > this, but there isn't much point, since it is doing useful things, like > checking if this is a spurio