[dm-devel] [PATCH v2 1/5] multipath: fix issues found by compiling with gcc 10

Martin Wilck martin.wilck at suse.com
Wed Dec 2 13:54:57 UTC 2020


Hi Ben,

On Wed, 2020-02-19 at 14:21 -0600, Benjamin Marzinski wrote:
> Signed-off-by: Benjamin Marzinski <bmarzins at redhat.com>
> ---
>  kpartx/dasd.c        |  6 +++---
>  libmultipath/print.c | 16 ++++++++--------
>  multipath/main.c     |  2 +-
>  3 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/kpartx/dasd.c b/kpartx/dasd.c
> index 1486ccaa..14b9d3aa 100644
> --- a/kpartx/dasd.c
> +++ b/kpartx/dasd.c
> @@ -186,7 +186,7 @@ read_dasd_pt(int fd, __attribute__((unused))
> struct slice all,
>  		goto out;
>  	}
>  
> -	if ((!info.FBA_layout) && (!strcmp(info.type, "ECKD")))
> +	if ((!info.FBA_layout) && (!memcmp(info.type, "ECKD", 4)))
>  		memcpy (&vlabel, data, sizeof(vlabel));
>  	else {
>  		bzero(&vlabel,4);

are you using different compiler / warning flags here than we usually do?

I just found that with the standard flags, gcc 10 does *not* complain about
the old (badly broken, noting that info.type is declared as char[4]) code.
Nor has any other compiler so far, although we're using pretty verbose 
warning options.

Regards
Martin

-- 
Dr. Martin Wilck <mwilck at suse.com>, Tel. +49 (0)911 74053 2107
SUSE  Software Solutions Germany GmbH
HRB 36809, AG Nürnberg GF: Felix
Imendörffer






More information about the dm-devel mailing list