From: Martin Wilck <martin.wilck@suse.com>
To: Benjamin Marzinski <bmarzins@redhat.com>, dm-devel@lists.linux.dev
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Subject: [PATCH 2/9] libmultipath: clarify code in set_path_removed()
Date: Fri, 9 Jan 2026 19:39:00 +0100 [thread overview]
Message-ID: <20260109183907.201250-3-mwilck@suse.com> (raw)
In-Reply-To: <20260109183907.201250-1-mwilck@suse.com>
Instead of remembering pp->mpp and setting it back after orphan_path(),
create a variant orphan_path__() that keeps pp->mpp set. The name
of this function is kind of misleading, but keep it as the main caller
is still orphan_path(), and we want to keep the well-known message.
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
libmultipath/structs_vec.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c
index 434b57c..8d4fc69 100644
--- a/libmultipath/structs_vec.c
+++ b/libmultipath/structs_vec.c
@@ -369,13 +369,18 @@ err:
return 1;
}
-void orphan_path(struct path *pp, const char *reason)
+static void orphan_path__(struct path *pp, const char *reason)
{
condlog(3, "%s: orphan path, %s", pp->dev, reason);
- pp->mpp = NULL;
uninitialize_path(pp);
}
+void orphan_path(struct path *pp, const char *reason)
+{
+ pp->mpp = NULL;
+ orphan_path__(pp, reason);
+}
+
static void orphan_paths(vector pathvec, struct multipath *mpp, const char *reason)
{
int i;
@@ -393,16 +398,13 @@ static void orphan_paths(vector pathvec, struct multipath *mpp, const char *reas
void set_path_removed(struct path *pp)
{
- struct multipath *mpp = pp->mpp;
-
- orphan_path(pp, "removed");
/*
* Keep link to mpp. It will be removed when the path
* is successfully removed from the map.
*/
- if (!mpp)
+ if (!pp->mpp)
condlog(0, "%s: internal error: mpp == NULL", pp->dev);
- pp->mpp = mpp;
+ orphan_path__(pp, "removed");
pp->initialized = INIT_REMOVED;
}
--
2.52.0
next prev parent reply other threads:[~2026-01-09 18:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-09 18:38 [PATCH 0/9] multipath-tools: more small fixes Martin Wilck
2026-01-09 18:38 ` [PATCH 1/9] libmultipath: reset pgindex in uninitialize_path() Martin Wilck
2026-01-09 18:39 ` Martin Wilck [this message]
2026-01-09 18:39 ` [PATCH 3/9] libmultipath: nullify pp->mpp before calling free_path() Martin Wilck
2026-01-09 18:39 ` [PATCH 4/9] libmultipath: log error when freeing path that refers to a map Martin Wilck
2026-01-09 18:39 ` [PATCH 5/9] libmultipath: sync_paths(): print message when fixing pp->mpp Martin Wilck
2026-01-09 18:39 ` [PATCH 6/9] libmultipath: don't free mpp->paths in group_paths() Martin Wilck
2026-01-09 18:39 ` [PATCH 7/9] libmultipath: warn only once in scsi_tmo_error_msg() Martin Wilck
2026-01-09 18:39 ` [PATCH 8/9] libmultipath: find_hwe(): fix gcc errors at high optimization levels Martin Wilck
2026-01-09 18:39 ` [PATCH 9/9] multipath-tools: compile with -fno-strict-aliasing Martin Wilck
2026-01-13 20:56 ` [PATCH 0/9] multipath-tools: more small fixes 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=20260109183907.201250-3-mwilck@suse.com \
--to=martin.wilck@suse.com \
--cc=bmarzins@redhat.com \
--cc=christophe.varoqui@opensvc.com \
--cc=dm-devel@lists.linux.dev \
/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.