[dm-devel] [PATCH v2 00/13] multipath-tools: improvements for pretty-printing code

Benjamin Marzinski bmarzins at redhat.com
Tue Nov 30 21:47:57 UTC 2021


On Mon, Nov 29, 2021 at 09:08:49PM +0100, mwilck at suse.com wrote:
> From: Martin Wilck <mwilck at suse.com>
> 
> Hi Christophe, hi Ben,
> 
> this series attempts to improve the robustness of the code by making the lookup
> tables used for pretty printing and wildcard handling static const arrays.
> This requires getting rid of the variable "width" field in these arrays.
> I could have simply split of "width" into a separate global array variable,
> but as the field width are designed to change depending on the data being
> printed, it makes more sense to use local variables for it and pass them to
> the actual table-formatting code.
> 
> A couple of minor cleanups are done along the way.
> 
> Changes in v2:
> 
>  - 10/13: fix a compilation error with clang because of duplicate typedef
>    for fieldwidth_t
>  - whitespace fixes
>  - 12/13: new, fix a compile error with clang-13
>  - 13/13: new, fix an asan error reported by Lixiaokeng
> 
> As always, feedback welcome
> Martin
> 

For the set:
Reviewed-by: Benjamin Marzinski <bmarzins at redhat.com>

> Martin Wilck (13):
>   libmultipath: make multipath_data etc. static
>   libmultipath: move path_data etc. to print.c
>   libmultipath: make pd_lookup() etc. return an index
>   libmultipath: use ARRAY_SIZE for iterating over wildcard arrays
>   libmultipath: drop padding code in _snprint_pathgroup()
>   libmultipath: snprint_foreign_topology(): split out lockless variant
>   multipathd: drop unnecessary path layout calls
>   libmultipath: add a cleanup function for unsigned char *
>   libmultipath: make sprint_path_marginal() static
>   libmultipath: introduce width argument for pretty-printing functions
>   libmultipath: change wildcard handler tables to static const
>   libmultipath: fix compilation error with clang 13
>   libmultipath: remove_map(): make sure orphaned paths aren't referenced
> 
>  libmultipath/foreign.c                   |  74 +++--
>  libmultipath/foreign.h                   |  23 +-
>  libmultipath/generic.h                   |   8 +
>  libmultipath/libmultipath.version        |   5 +-
>  libmultipath/print.c                     | 356 +++++++++++++----------
>  libmultipath/print.h                     |  58 ++--
>  libmultipath/prioritizers/weightedpath.c |   3 +-
>  libmultipath/structs_vec.c               |   4 +
>  libmultipath/util.c                      |   5 +
>  libmultipath/util.h                      |   1 +
>  multipath/main.c                         |   7 +-
>  multipathd/cli_handlers.c                |  75 +++--
>  12 files changed, 367 insertions(+), 252 deletions(-)
> 
> -- 
> 2.33.1




More information about the dm-devel mailing list