All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: Brian Bunker <brian@purestorage.com>
Cc: dm-devel@lists.linux.dev, Martin Wilck <mwilck@suse.com>,
	Christophe Varoqui <christophe.varoqui@opensvc.com>
Subject: Re: [PATCH v5 1/1] multipathd: recheck WWIDs of re-added paths with the device
Date: Mon, 30 Nov 2026 20:24:24 -0500	[thread overview]
Message-ID: <aw4hyKRMjnLFt6uo@redhat.com> (raw)
In-Reply-To: <20261130202558.28849-2-brian@purestorage.com>

On Mon, Nov 30, 2026 at 12:25:58PM -0800, Brian Bunker wrote:
> multipathd takes a path's WWID from udev. When a change uevent reports
> a different WWID, uev_update_path() removes the path from its map and
> re-adds it through uev_add_path(), which places it in whatever map owns
> the new WWID. The removal can block for seconds while the map is
> suspended, so by the time the path is re-added, the WWID in the uevent
> may no longer be what the device reports. If it is wrong, the path goes
> into the map of a different LUN and I/O for one LUN is silently sent to
> another.
> 
> If recheck_wwid is set and the path is up, confirm the WWID with the
> device over SG_IO before such a re-add puts the path into a map, as
> recheck_wwid already does when a failed path comes back. If the device
> doesn't confirm it, or its WWID can't be read, leave the path out of
> the map: orphan it, clear its WWID and mark it INIT_MISSING_UDEV, so
> the checker retriggers udev after retrigger_delay and the path is
> re-added from fresh data. A path that isn't up is checked by
> recheck_wwid once it comes up.
> 
> To tell these re-adds from ordinary adds, turn the need_do_map argument
> of uev_add_path() and ev_add_path() into enum path_add_mode, with a new
> PATH_ADD_REINIT value that behaves like PATH_ADD_MAP. It is passed only
> for the re-add at the end of uev_update_path() after udev reported a
> changed WWID. The re-add after a udev retrigger, and ordinary adds, are
> unchanged, so udev data obtained by a retrigger is trusted.
> 
> Split check_path_wwid() out of check_path_wwid_change() so that a
> failure to read the device's WWID can be told apart from a match.
> check_path_wwid_change() still returns true only on a mismatch.
> 
> Document the new case under recheck_wwid in multipath.conf(5).

Look pretty good. One minor possible change below. Feel free to tell me
I'm trying to abuse path_add_mode.
 
> Signed-off-by: Brian Bunker <brian@purestorage.com>
> ---
>  multipath/multipath.conf.5.in |  8 ++--
>  multipathd/cli_handlers.c     |  2 +-
>  multipathd/main.c             | 74 +++++++++++++++++++++++++++--------
>  multipathd/main.h             | 13 +++++-
>  4 files changed, 75 insertions(+), 22 deletions(-)
> 
> diff --git a/multipathd/main.c b/multipathd/main.c
> index 9bce4d6b..e32128a3 100644
> --- a/multipathd/main.c
> +++ b/multipathd/main.c

[...]

> @@ -1656,6 +1694,7 @@ uev_update_path (struct uevent *uev, struct vectors * vecs)
>  	struct path * pp;
>  	struct config *conf;
>  	int needs_reinit = 0;
> +	enum path_add_mode reinit_mode = PATH_ADD_MAP;

Since we're tracking the reinit_mode with a path_add_mode enum, it seems
to me like needs_reinit is unnecessary. We could just default
reinit_mode to PATH_ADD_NO_MAP, and either set it to PATH_ADD_MAP for a
INIT_REQUESTED_UDEV path or PATH_ADD_REINIT for a changed wwid path.
Then, instead of checking need_reinit at the end of the function,
we could just check (reinit_mode != PATH_ADD_NO_MAP). Obviously
other callers of uev_add_path() do pass in PATH_ADD_NO_MAP as
a mode, so if people think this usage is confusing and not worth
removing a redundant variable, that's fine.

-Ben


  reply	other threads:[~2026-12-01  1:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 20:25 [PATCH v5 0/1] multipathd: recheck WWIDs of re-added paths with the device Brian Bunker
2026-11-30 20:25 ` [PATCH v5 1/1] " Brian Bunker
2026-12-01  1:24   ` Benjamin Marzinski [this message]
2026-12-01 18:41     ` Brian Bunker

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=aw4hyKRMjnLFt6uo@redhat.com \
    --to=bmarzins@redhat.com \
    --cc=brian@purestorage.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@lists.linux.dev \
    --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.