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

2020-09-07 Thread lixiaokeng
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 Signed-off-by: Zhiqiang Liu Signed-off-by: Lixiaokeng Signed-off-by: Linfeilong --- multipathd/cli_handlers.c | 2 ++ 1 file changed, 2 inse

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

2020-09-07 Thread lixiaokeng
In mpath_pr_event_handler_fn, we use MALLOC instead of malloc, and check the return value of MALLOC. V1->V2: delete seting ret when jump to out Signed-off-by: Lixiaokeng Signed-off-by: Zhiqiang Liu Signed-off-by: Linfeilong --- multipathd/main.c | 8 1 file changed, 4 insertions(+),

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

2020-09-07 Thread lixiaokeng
We check the return value of malloc in print_foreign_topology. V1->V2: chanege malloc to calloc Signed-off-by: Lixiaokeng Signed-off-by: Zhiqiang Liu Signed-off-by: Linfeilong --- libmultipath/foreign.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmultipath/forei

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

2020-09-07 Thread lixiaokeng
If dm_get_major_minor failed, log with major and minor should not be printed to avoid major and minor used before initialization. V1->V2: set major and minor to -1 at begining Signed-off-by: Lixiaokeng Signed-off-by: Zhiqiang Liu Signed-off-by: Linfeilong --- multipathd/cli_handlers.c | 2 +-

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

2020-09-07 Thread lixiaokeng
Patches 01, 02, 04, 05, 06, 09, 11, 12, 14 have some changes. 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: delete seting ret when jump to out, as suggested

Re: [dm-devel] [PATCH 1/1] block: move the PAGE_SECTORS definition into

2020-09-07 Thread Leizhen (ThunderTown)
Hi, Jens Axboe, Alasdair Kergon, Mike Snitzer: What's your opinion? On 2020/8/21 15:05, Coly Li wrote: > On 2020/8/21 14:48, Leizhen (ThunderTown) wrote: >> >> >> On 8/21/2020 12:11 PM, Coly Li wrote: >>> On 2020/8/21 10:03, Zhen Lei wrote: There are too many PAGE_SECTORS definitions, and

[dm-devel] fix for kernel BUG at drivers/scsi/device_handler/scsi_dh_alua.c:662!

2020-09-07 Thread Brian Bunker
Hello all, >From my earlier post: https://www.redhat.com/archives/dm-devel/2020-September/msg00083.html Would it be better to move the unsetting the address of sdev to NULL lower? This would protect against the crash we see when the alua_rtpg function tries to access the sdev address that has b

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. I

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

2020-09-07 Thread lixiaokeng
> Looks mostly good. I agree that we should be checking the results of > getting the raw data before we try to disassemble it. But, there's not > really any point to calling continue as the last operation of a loop. > Perhaps > > if (update_multipath_table(mpp, pathvec, DI_CHECKER) == DMP_OK) >

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

2020-09-07 Thread lixiaokeng
>> >> -paramp= malloc(sizeof(struct prout_param_descriptor) + >> (sizeof(struct transportid *)*(MPATH_MX_TIDS ))); >> - >> -memset(paramp, 0, sizeof(struct prout_param_descriptor) + >> (sizeof(struct transportid *)*(MPATH_MX_TIDS))); > > When looking at your patch, I no

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

2020-09-07 Thread lixiaokeng
>> @@ -86,9 +86,12 @@ assemble_map (struct multipath * mp, char * params, int >> len) >> get_linux_version_code() < KERNEL_VERSION(4, 3, 0)) >> add_feature(&mp->features, retain_hwhandler); >> >> -f = STRDUP(mp->features); > > clearly strdup()ing without checking if mp

Re: [dm-devel] [PATCH 08/14] libmultipath: donot free *dst if REALLOC fails in, merge_words

2020-09-07 Thread lixiaokeng
Hi Ben: I think you are right. We should not keep them with partial information. Thanks for your review. -Lixiaokeng On 2020/9/5 5:11, Benjamin Marzinski wrote: > On Wed, Sep 02, 2020 at 03:20:29PM +0800, lixiaokeng wrote: >> In merge_words func, if REALLOC() fails, the input *dst will >> be fr