All of lore.kernel.org
 help / color / mirror / Atom feed
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 10/14] libmpathpersist: only clear the key if we are using the prkeys file
Date: Thu, 28 Aug 2025 23:21:54 -0400	[thread overview]
Message-ID: <aLEc0gW0zNvIA274@redhat.com> (raw)
In-Reply-To: <7ceefd5d4a7fb72cb0162e3ef4c23286d128be09.camel@suse.com>

On Mon, Aug 25, 2025 at 06:21:59PM +0200, Martin Wilck wrote:
> On Fri, 2025-07-25 at 23:58 -0400, Benjamin Marzinski wrote:
> > Otherwise this request will create a useless prkeys file.
> > 
> > Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
> > ---
> >  libmpathpersist/mpath_persist_int.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libmpathpersist/mpath_persist_int.c
> > b/libmpathpersist/mpath_persist_int.c
> > index dfdadab6..f901b955 100644
> > --- a/libmpathpersist/mpath_persist_int.c
> > +++ b/libmpathpersist/mpath_persist_int.c
> > @@ -831,7 +831,8 @@ int do_mpath_persistent_reserve_out(vector curmp,
> > vector pathvec, int fd,
> >  		break;
> >  	case MPATH_PROUT_CLEAR_SA:
> >  		update_prflag(mpp->alias, 0);
> > -		update_prkey(mpp->alias, 0);
> > +		if (mpp->prkey_source == PRKEY_SOURCE_FILE)
> > +			update_prkey(mpp->alias, 0);
> 
> Should this condition be checked in update_prkey_flags() directly?

We could, but it would just end up being a pointless extra check most of
the time. Aside from the CLEAR command, we only set the prkey when we
are registering a key or reverting the prkey if that registration
failed. When we first set it during register, we need to check
prkey_source early, since there is a bunch of things we can't do if we
aren't using the prkeys file. And we don't want to revert it unless we
updated it and have an old value to revert to.  In both cases we already
had to do the necessary check before calling update_prkey(). The CLEAR
command is the only one where we don't need to check if we are using the
prkeys file earlier. So, I'd prefer to leave the check outside of
update_prkey_flags() here as well, to avoid the unnecessary extra work.

-Ben

> 
> Martin


  reply	other threads:[~2025-08-29  3:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-26  3:58 [PATCH 00/14] Additional fixes and cleanups Benjamin Marzinski
2025-07-26  3:58 ` [PATCH 01/14] limpathpersist: remove update_map_pr code for NULL pp Benjamin Marzinski
2025-07-26  3:58 ` [PATCH 02/14] libmpathpersist: move update_map_pr to multipathd Benjamin Marzinski
2025-07-26  3:58 ` [PATCH 03/14] multipathd: clean up update_map_pr and mpath_pr_event_handle Benjamin Marzinski
2025-07-26  3:58 ` [PATCH 04/14] libmpathpersist: clean up duplicate function declarations Benjamin Marzinski
2025-07-26  3:58 ` [PATCH 05/14] multipathd: wrap setting and unsetting prflag Benjamin Marzinski
2025-07-26  3:58 ` [PATCH 06/14] multipathd: unregister PR key when path is restored if necessary Benjamin Marzinski
2025-07-26  3:58 ` [PATCH 07/14] libmpathpersist: Fix-up reservation_key checking Benjamin Marzinski
2025-07-26  3:58 ` [PATCH 08/14] libmpathpersist: change how reservation conflicts are handled Benjamin Marzinski
2025-07-26  3:58 ` [PATCH 09/14] libmpathpersist: Clear prkey in multipathd before unregistering Benjamin Marzinski
2025-07-26  3:58 ` [PATCH 10/14] libmpathpersist: only clear the key if we are using the prkeys file Benjamin Marzinski
2025-08-25 16:21   ` Martin Wilck
2025-08-29  3:21     ` Benjamin Marzinski [this message]
2025-08-29  7:28       ` Martin Wilck
2025-07-26  3:58 ` [PATCH 11/14] libmpathpersist: Restore old reservation key on failure Benjamin Marzinski
2025-07-26  3:58 ` [PATCH 12/14] libmpatpersist: update reservation key before checking paths Benjamin Marzinski
2025-08-25 16:36   ` Martin Wilck
2025-08-29  3:37     ` Benjamin Marzinski
2025-08-29  7:35       ` Martin Wilck
2025-07-26  3:58 ` [PATCH 13/14] libmpathpersist: retry on conflicts in mpath_prout_common Benjamin Marzinski
2025-07-26  3:58 ` [PATCH 14/14] libmpathpersist: Don't always fail registrations for retryable errors Benjamin Marzinski
2025-08-25 21:46 ` [PATCH 00/14] Additional fixes and cleanups 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=aLEc0gW0zNvIA274@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.