On Wed, Sep 02, 2020 at 03:25:28PM +0800, lixiaokeng wrote: > The return values of dm_get_map, disassemble_map,dm_get_status > and disassemble_status in check_usable_paths were not checked. > Use update_multipath_table/status to instead of them. > Reviewed-by: Benjamin Marzinski <bmarzins@xxxxxxxxxx> > Signed-off-by: Lixiaokeng <lixiaokeng@xxxxxxxxxx> > Signed-off-by: Zhiqiang Liu <liuzhiqiang26@xxxxxxxxxx> > Signed-off-by: Linfeilong <linfeilong@xxxxxxxxxx> > --- > multipath/main.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/multipath/main.c b/multipath/main.c > index d227e0b3..9e920d89 100644 > --- a/multipath/main.c > +++ b/multipath/main.c > @@ -251,7 +251,6 @@ static int check_usable_paths(struct config *conf, > struct path *pp; > char *mapname; > vector pathvec = NULL; > - char params[PARAMS_SIZE], status[PARAMS_SIZE]; > dev_t devt; > int r = 1, i, j; > > @@ -285,11 +284,9 @@ static int check_usable_paths(struct config *conf, > if (mpp == NULL) > goto free; > > - dm_get_map(mpp->alias, &mpp->size, params); > - dm_get_status(mpp->alias, status); > - disassemble_map(pathvec, params, mpp); > - update_pathvec_from_dm(pathvec, mpp, 0); > - disassemble_status(status, mpp); > + if (update_multipath_table(mpp, pathvec, 0) != DMP_OK || > + update_multipath_status(mpp) != DMP_OK) > + goto free; > > vector_foreach_slot (mpp->pg, pg, i) { > vector_foreach_slot (pg->paths, pp, j) { > -- -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel