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/15] libmpathpersist: fail the release if all threads fail
Date: Thu, 28 Aug 2025 23:23:07 -0400	[thread overview]
Message-ID: <aLEdG_pKGS-BKzRq@redhat.com> (raw)
In-Reply-To: <897959294c661240be74a785b7790c95af4c010d.camel@suse.com>

On Sun, Aug 24, 2025 at 05:33:07PM +0200, Martin Wilck wrote:
> On Thu, 2025-07-10 at 14:10 -0400, Benjamin Marzinski wrote:
> > If none of the threads succeeds in issuing the release, simply return
> > failure, instead of trying the workaround.
> > 
> > Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
> > ---
> >  libmpathpersist/mpath_persist_int.c | 12 +++++++++---
> >  1 file changed, 9 insertions(+), 3 deletions(-)
> > 
> > diff --git a/libmpathpersist/mpath_persist_int.c
> > b/libmpathpersist/mpath_persist_int.c
> > index 7fb08b2e..ad5a4ee7 100644
> > --- a/libmpathpersist/mpath_persist_int.c
> > +++ b/libmpathpersist/mpath_persist_int.c
> > @@ -475,15 +475,21 @@ static int mpath_prout_rel(struct multipath
> > *mpp,int rq_servact, int rq_scope,
> >  		}
> >  	}
> >  
> > +	rc = MPATH_PR_DMMP_ERROR;
> 
> I find the relationship between "status" and "rc" a bit confusing in
> this patch. Can we use something like "bool all_failed" instead?

Sure.

-Ben

> 
> Martin
> 
> 
> >  	for (i = 0; i < count; i++){
> >  		/*  check thread status here and return the status
> > */
> >  
> > -		if (thread[i].param.status ==
> > MPATH_PR_RESERV_CONFLICT)
> > +		if (thread[i].param.status == MPATH_PR_SUCCESS)
> > +			rc = MPATH_PR_SUCCESS;
> > +		else if (thread[i].param.status ==
> > MPATH_PR_RESERV_CONFLICT)
> >  			status = MPATH_PR_RESERV_CONFLICT;
> > -		else if (status == MPATH_PR_SUCCESS
> > -				&& thread[i].param.status !=
> > MPATH_PR_RESERV_CONFLICT)
> > +		else if (status == MPATH_PR_SUCCESS)
> >  			status = thread[i].param.status;
> >  	}
> > +	if (rc != MPATH_PR_SUCCESS) {
> > +		condlog(0, "%s: all threads failed to release
> > reservation.", mpp->wwid);
> > +		return status;
> > +	}
> >  
> >  	status = mpath_prin_activepath (mpp, MPATH_PRIN_RRES_SA,
> > &resp, noisy);
> >  	if (status != MPATH_PR_SUCCESS){


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

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-10 18:10 [PATCH 00/15] Improve mpathpersist's unavailable path handling Benjamin Marzinski
2025-07-10 18:10 ` [PATCH 01/15] multipathd: remove thread from mpath_pr_event_handle Benjamin Marzinski
2025-07-10 18:10 ` [PATCH 02/15] libmpathpersist: remove uneeded wrapper function Benjamin Marzinski
2025-07-10 18:10 ` [PATCH 03/15] libmpathpersist: reduce log level for persistent reservation checking Benjamin Marzinski
2025-08-24 12:57   ` Martin Wilck
2025-08-25 15:36     ` Martin Wilck
2025-07-10 18:10 ` [PATCH 04/15] libmpathpersist: remove pointless update_map_pr ret value code Benjamin Marzinski
2025-07-10 18:10 ` [PATCH 05/15] multipathd: use update_map_pr in mpath_pr_event_handle Benjamin Marzinski
2025-07-10 18:10 ` [PATCH 06/15] libmpathpersist: limit changing prflag in update_map_pr Benjamin Marzinski
2025-07-10 18:10 ` [PATCH 07/15] multipathd: Don't call update_map_pr unnecessarily Benjamin Marzinski
2025-07-10 18:10 ` [PATCH 08/15] libmpathpersist: remove useless function send_prout_activepath Benjamin Marzinski
2025-07-10 18:10 ` [PATCH 09/15] limpathpersist: redesign failed release workaround Benjamin Marzinski
2025-08-24 15:26   ` Martin Wilck
2025-08-26  0:51     ` Benjamin Marzinski
2025-08-26  8:44       ` Martin Wilck
2025-08-26 10:06         ` Martin Wilck
2025-08-26 21:07           ` Benjamin Marzinski
2025-08-27  6:45             ` Martin Wilck
2025-08-26 19:36         ` Benjamin Marzinski
2025-08-26 20:53           ` Martin Wilck
2025-07-10 18:10 ` [PATCH 10/15] libmpathpersist: fail the release if all threads fail Benjamin Marzinski
2025-08-24 15:33   ` Martin Wilck
2025-08-29  3:23     ` Benjamin Marzinski [this message]
2025-07-10 18:10 ` [PATCH 11/15] limpathpersist: Handle changing key corner case Benjamin Marzinski
2025-07-11 12:15   ` Martin Wilck
2025-07-11 14:11     ` Martin Wilck
2025-07-14 16:59       ` Benjamin Marzinski
2025-07-14 17:15         ` Martin Wilck
2025-07-10 18:10 ` [PATCH 12/15] libmapthpersist: Handle REGISTER AND IGNORE " Benjamin Marzinski
2025-07-10 18:10 ` [PATCH 13/15] libmultipath: rename prflag_value enums Benjamin Marzinski
2025-07-10 18:10 ` [PATCH 14/15] libmpathpersist: use a switch statement for prout command finalizing Benjamin Marzinski
2025-07-10 18:11 ` [PATCH 15/15] libmpathpersist: Add safety check for preempting on key change Benjamin Marzinski
2025-08-24 21:00   ` Martin Wilck
2025-08-25 15:46     ` Martin Wilck
2025-08-24 21:21 ` [PATCH 00/15] Improve mpathpersist's unavailable path handling Martin Wilck
2025-08-25  6:38 ` Hannes Reinecke
2025-08-25 19:56   ` Benjamin Marzinski
2025-08-26  6:06     ` Hannes Reinecke

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=aLEdG_pKGS-BKzRq@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.