From: Benjamin Marzinski <bmarzins@redhat.com>
To: Martin Wilck <martin.wilck@suse.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>,
device-mapper development <dm-devel@lists.linux.dev>
Subject: Re: [PATCH 17/22] multipathd: handle changed wwid when adding partial path
Date: Tue, 16 Jul 2024 11:45:20 -0400 [thread overview]
Message-ID: <ZpaVkLv9CMLdNbgb@redhat.com> (raw)
In-Reply-To: <c1221783863ab8faf540e82620cabeca738c670c.camel@suse.com>
On Mon, Jul 15, 2024 at 09:40:36PM +0200, Martin Wilck wrote:
> On Sat, 2024-07-13 at 02:05 -0400, Benjamin Marzinski wrote:
> > If multipathd noticed that the WWID didn't match the device when
> > adding
> > a partial path, but removing it failed, multipathd wasn't disabling
> > the
> > path. Instead of calling handle_path_wwid_change(), which doesn't
> > make
> > much sense when multipathd is expecting a uevent, just manually
> > disable
> > the path if ev_remove_path() fails.
> >
> > Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
> > ---
> > multipathd/cli_handlers.c | 6 +++++-
> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c
> > index 0643be15..5d8ba3a6 100644
> > --- a/multipathd/cli_handlers.c
> > +++ b/multipathd/cli_handlers.c
> > @@ -540,7 +540,11 @@ add_partial_path(struct path *pp, struct vectors
> > *vecs)
> > if (strlen(wwid) && strncmp(wwid, pp->wwid, WWID_SIZE) != 0)
> > {
> > condlog(0, "%s: path wwid changed from '%s' to '%s'.
> > removing",
> > pp->dev, wwid, pp->wwid);
> > - ev_remove_path(pp, vecs, 1);
> > + if (!(ev_remove_path(pp, vecs, 1) &
> > REMOVE_PATH_SUCCESS) &&
> > + pp->mpp) {
> > + pp->dmstate = PSTATE_FAILED;
> > + dm_fail_path(pp->mpp->alias, pp->dev_t);
> > + }
> > udev_device_unref(udd);
> > return -1;
> > }
>
>
> Is this sufficient? Can we be certain that this path won't be
> reinstated by sync_map_state() later on? That's at least not
> immediately obvious. Perhaps we should orphan the path?
We can't orphan the path completely. That's why ev_remove_path() calls
set_path_removed(), which keeps track of the fact it's still in the mpp,
so that we can complete the removal once it is actually removed from the
multipath device. Otherwise multipathd could just add it to another
device, while it was still part of the old device.
But you are correct about sync_map_state(). Good catch. We usually never
need to worry about sync_map_state() restoring paths in INIT_REMOVED,
since they really have been removed. In this case we do. We should
probably be setting pp->state to PATH_UNCHECKED in orphan_path() anyway,
which will keep sync_map_state() from restoring it. Since the path is
in INIT_REMOVED, check_path will never update it's state. But
sync_map_state() should also be ignoring paths in INIT_REMOVED. I vote
we do both.
-Ben
>
> Martin
next prev parent reply other threads:[~2024-07-16 15:45 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-13 6:04 [PATCH 00/22] path checker refactor and misc fixes Benjamin Marzinski
2024-07-13 6:04 ` [PATCH 01/22] libmultipath: rename dm_map_present_by_wwid() and add outputs Benjamin Marzinski
2024-07-15 10:53 ` Martin Wilck
2024-07-15 15:51 ` Martin Wilck
2024-07-15 15:14 ` Martin Wilck
2024-07-16 14:22 ` Benjamin Marzinski
2024-07-13 6:04 ` [PATCH 02/22] multipathd: make cli_add_map() handle adding maps by WWID correctly Benjamin Marzinski
2024-07-13 6:04 ` [PATCH 03/22] multipathd: remove checker restart optimization Benjamin Marzinski
2024-07-13 6:04 ` [PATCH 04/22] multipathd: refactor path state getting code into a helper Benjamin Marzinski
2024-07-15 15:19 ` Martin Wilck
2024-07-15 16:07 ` Martin Wilck
2024-07-13 6:04 ` [PATCH 05/22] multipathd: handle uninitialized paths in new function Benjamin Marzinski
2024-07-15 15:34 ` Martin Wilck
2024-07-15 15:36 ` Martin Wilck
2024-07-16 14:23 ` Benjamin Marzinski
2024-07-13 6:04 ` [PATCH 06/22] multipathd: make check_path() static Benjamin Marzinski
2024-07-13 6:04 ` [PATCH 07/22] multipathd: remove redundant checks in handle_uninitialized_path() Benjamin Marzinski
2024-07-13 6:04 ` [PATCH 08/22] multipathd: check paths immediately after failing udev initialization Benjamin Marzinski
2024-07-15 15:39 ` Martin Wilck
2024-07-13 6:04 ` [PATCH 09/22] multipathd: set pp->tick = max_checkint in handle_uninitialized_path Benjamin Marzinski
2024-07-15 16:00 ` Martin Wilck
2024-07-16 14:52 ` Benjamin Marzinski
2024-07-16 15:31 ` Martin Wilck
2024-07-13 6:04 ` [PATCH 10/22] multipathd: return 0 from path_check() if that path wasn't checked Benjamin Marzinski
2024-07-15 16:05 ` Martin Wilck
2024-07-16 14:52 ` Benjamin Marzinski
2024-07-13 6:04 ` [PATCH 11/22] multipathd: reorder path state checks Benjamin Marzinski
2024-07-15 16:23 ` Martin Wilck
2024-07-13 6:04 ` [PATCH 12/22] multipathd: adjust when mpp is synced with the kernel Benjamin Marzinski
2024-07-15 16:23 ` Martin Wilck
2024-07-16 15:14 ` Benjamin Marzinski
2024-07-13 6:04 ` [PATCH 13/22] multipathd: resync map after setup_map in ev_remove_path Benjamin Marzinski
2024-07-15 16:32 ` Martin Wilck
2024-07-16 15:15 ` Benjamin Marzinski
2024-07-13 6:04 ` [PATCH 14/22] multipathd: resync map after setup_map in resize_map Benjamin Marzinski
2024-07-13 6:04 ` [PATCH 15/22] multipathd: always resync map in reload_and_sync_map Benjamin Marzinski
2024-07-15 16:40 ` Martin Wilck
2024-07-13 6:05 ` [PATCH 16/22] multipathd: correctly handle paths removed for a wwid change Benjamin Marzinski
2024-07-15 19:16 ` Martin Wilck
2024-07-16 15:16 ` Benjamin Marzinski
2024-07-13 6:05 ` [PATCH 17/22] multipathd: handle changed wwid when adding partial path Benjamin Marzinski
2024-07-15 19:40 ` Martin Wilck
2024-07-16 15:45 ` Benjamin Marzinski [this message]
2024-07-13 6:05 ` [PATCH 18/22] multipathd: don't read conf->checkint twice in check_path Benjamin Marzinski
2024-07-15 19:41 ` Martin Wilck
2024-07-13 6:05 ` [PATCH 19/22] multipathd: make multipath devices manage their path check times Benjamin Marzinski
2024-07-15 20:49 ` Martin Wilck
2024-07-16 16:36 ` Martin Wilck
2024-07-16 18:26 ` Benjamin Marzinski
2024-07-16 18:23 ` Benjamin Marzinski
2024-07-13 6:05 ` [PATCH 20/22] multipathd: factor out actual path checking loop from checkerloop Benjamin Marzinski
2024-07-15 20:54 ` Martin Wilck
2024-07-13 6:05 ` [PATCH 21/22] multipathd: check paths in order by mpp Benjamin Marzinski
2024-07-15 21:19 ` Martin Wilck
2024-07-16 20:00 ` Benjamin Marzinski
2024-07-13 6:05 ` [PATCH 22/22] multipathd: clean up the correct wwid in check_path_wwid_change Benjamin Marzinski
2024-07-15 21:22 ` Martin Wilck
2024-07-16 20:00 ` Benjamin Marzinski
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=ZpaVkLv9CMLdNbgb@redhat.com \
--to=bmarzins@redhat.com \
--cc=christophe.varoqui@opensvc.com \
--cc=dm-devel@lists.linux.dev \
--cc=martin.wilck@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.