From: Benjamin Marzinski <bmarzins@redhat.com>
To: Martin Wilck <martin.wilck@suse.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>,
dm-devel@lists.linux.dev, Martin Wilck <mwilck@suse.com>
Subject: Re: [PATCH 2/3] libmultipath: pgcmp(): compare number of paths
Date: Mon, 25 Nov 2024 16:06:52 -0500 [thread overview]
Message-ID: <Z0Tm7AJeGdZs5WIS@redhat.com> (raw)
In-Reply-To: <20241125143224.51934-3-mwilck@suse.com>
On Mon, Nov 25, 2024 at 03:32:23PM +0100, Martin Wilck wrote:
> pathcmp() makes sure that all paths in pgp have a match in cpgp, but not
> vice-versa. Check the number of paths, too.
This looks fine. But looking at it made we a nervous about cpgp->id. We
only calculate that in pgcmp() (and just for mpp, not cmpp) and in
disassemble_map(). But we clearly can have pathgroup changes after that,
as the last patch has shown. To be safe, we should either skip the whole
pgp->id thing (it's not a huge time savings) or recalculate it for all
of cmpp's path groups before we start the loops in pgcmp().
-Ben
>
> Fixes: 90773ba ("libmultipath: resolve hash collisions in pgcmp()")
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
> libmultipath/configure.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/libmultipath/configure.c b/libmultipath/configure.c
> index d0e9c95..55140d0 100644
> --- a/libmultipath/configure.c
> +++ b/libmultipath/configure.c
> @@ -442,6 +442,7 @@ pgcmp (struct multipath * mpp, struct multipath * cmpp)
>
> vector_foreach_slot (cmpp->pg, cpgp, j) {
> if (pgp->id == cpgp->id &&
> + VECTOR_SIZE(pgp->paths) == VECTOR_SIZE(cpgp->paths) &&
> !pathcmp(pgp, cpgp)) {
> r = 0;
> break;
> --
> 2.47.0
next prev parent reply other threads:[~2024-11-25 21:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-25 14:32 [PATCH 0/3] multipath-tools fixes Martin Wilck
2024-11-25 14:32 ` [PATCH 1/3] libmultipath: fix handling of pp->pgindex Martin Wilck
2024-11-25 20:31 ` Benjamin Marzinski
2024-11-26 11:12 ` Martin Wilck
2024-11-26 17:41 ` Benjamin Marzinski
2024-11-25 14:32 ` [PATCH 2/3] libmultipath: pgcmp(): compare number of paths Martin Wilck
2024-11-25 21:06 ` Benjamin Marzinski [this message]
2024-11-26 11:15 ` Martin Wilck
2024-11-26 11:17 ` Martin Wilck
2024-11-26 17:43 ` Benjamin Marzinski
2024-11-25 14:32 ` [PATCH 3/3] libmultipath: move pathcmp() to configure.c Martin Wilck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z0Tm7AJeGdZs5WIS@redhat.com \
--to=bmarzins@redhat.com \
--cc=christophe.varoqui@opensvc.com \
--cc=dm-devel@lists.linux.dev \
--cc=martin.wilck@suse.com \
--cc=mwilck@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.