Linux Device Mapper development
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: device-mapper development <dm-devel@redhat.com>,
	Martin Wilck <Martin.Wilck@suse.com>
Subject: Re: [dm-devel] [PATCH] mpathpersist: Fix Register and Ignore with 0x00 SARK
Date: Mon, 23 Nov 2020 20:50:15 -0600	[thread overview]
Message-ID: <20201124025015.GC3103@octiron.msp.redhat.com> (raw)
In-Reply-To: <1604963562-31905-1-git-send-email-bmarzins@redhat.com>

On Mon, Nov 09, 2020 at 05:12:42PM -0600, Benjamin Marzinski wrote:
> When the Register and Ignore command is run with sg_persist, if a 0x00
> Service Action Reservation Key is given or the --param-sark option is
> not used at all, sg_persist will clear the registration.  mpathpersist
> will fail with an error.  This patch fixes mpathpersist to work like
> sg_persist in this case.
>

NACK. This only fixes the case where "reservation_key" is set to "file".
It also needlessly clears the key in the prkeys file twice. I'll send
a fixed version.

-Ben
 
> Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
> ---
>  libmpathpersist/mpath_persist.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c
> index 79322e86..703f8e13 100644
> --- a/libmpathpersist/mpath_persist.c
> +++ b/libmpathpersist/mpath_persist.c
> @@ -289,8 +289,8 @@ int __mpath_persistent_reserve_out ( int fd, int rq_servact, int rq_scope,
>  	put_multipath_config(conf);
>  
>  	memcpy(&prkey, paramp->sa_key, 8);
> -	if (mpp->prkey_source == PRKEY_SOURCE_FILE && prkey &&
> -	    ((!get_be64(mpp->reservation_key) &&
> +	if (mpp->prkey_source == PRKEY_SOURCE_FILE &&
> +	    ((!get_be64(mpp->reservation_key) && prkey &&
>  	      rq_servact == MPATH_PROUT_REG_SA) ||
>  	     rq_servact == MPATH_PROUT_REG_IGN_SA)) {
>  		memcpy(&mpp->reservation_key, paramp->sa_key, 8);
> -- 
> 2.17.2
> 
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel


      reply	other threads:[~2020-11-24  2:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09 23:12 [dm-devel] [PATCH] mpathpersist: Fix Register and Ignore with 0x00 SARK Benjamin Marzinski
2020-11-24  2:50 ` Benjamin Marzinski [this message]

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=20201124025015.GC3103@octiron.msp.redhat.com \
    --to=bmarzins@redhat.com \
    --cc=Martin.Wilck@suse.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox