All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Wilck <mwilck@suse.com>
To: Benjamin Marzinski <bmarzins@redhat.com>,
	device-mapper development <dm-devel@redhat.com>
Subject: Re: [PATCH 4/5] multipath: add alternate reservation_key method
Date: Fri, 08 Sep 2017 23:34:48 +0200	[thread overview]
Message-ID: <1504906488.4585.31.camel@suse.com> (raw)
In-Reply-To: <1504896354-28181-5-git-send-email-bmarzins@redhat.com>

On Fri, 2017-09-08 at 13:45 -0500, Benjamin Marzinski wrote:
> The scsi persistent reservation API doesn't force devices to
> implement
> any method to display the mapping from a reservation key to an I_T
> Nexus
> (the READ_FULL_STATUS action is an optional later addition, and a
> number
> of devices don't support it). To allow multipathd to determine the
> correct reservation key for a device without support from the device
> itself, it uses the reservation_key configuration option.
> Unfortunately,
> using this option forces the multipath configuration to be updated
> whenever a new scsi registration key is used.  This isn't acceptable
> to
> some users, who want a static configuration file.
> 
> This patch provides an alternate method of setting the
> reservation_key
> for the multipath device. The reservation_key configuration option
> now
> also accepts the keyword "file". If this is used, multpath will look
> in
> the new prkeys file (by default "/etc/multipath/prkeys") for a line
> with
> the device wwid and it's associated reservation_key. Where a device's
> reservation key comes from is tracked by the prkey_source variable,
> which is set and read through the reservation_key dict.c functions.
> 
> There are also new multipathd commands to get, set, and unset the
> mappings in the prkesy file. Currently,
> 
> "multipathd map $map setprkey key $key" sets the mapping
> "multipathd map $map unsetprkey" unsets the mapping
> "multipathd map $map getprkey" gets the current reservation_key for a
> multipath device.
> 
> There is some lack of symmetry here where you are allowed to set and
> unset mappings even for devices that aren't configured to use the
> prkeys
> file, but you will only get the mapping from the prkeys file for
> devices
> that are configured to use it. Otherwise you will get the mapping
> from
> multipath.conf. In other words, setprkey and unsetprkey return
> success
> but don't do anything useful unless a device is configured with
> 
> reservation_key file
> 
> but getprkey will return the device's current reservation_key
> regardless
> of where the key came from.
> 
> Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
> ---
>  libmultipath/Makefile     |   2 +-
>  libmultipath/config.c     |   6 +-
>  libmultipath/config.h     |   3 +
>  libmultipath/defaults.h   |   1 +
>  libmultipath/dict.c       |  67 +++++++++++++++----
>  libmultipath/dict.h       |   2 +-
>  libmultipath/prkey.c      | 166
> ++++++++++++++++++++++++++++++++++++++++++++++
>  libmultipath/prkey.h      |  19 ++++++
>  libmultipath/propsel.c    |  31 +++++++--
>  libmultipath/structs.h    |   7 ++
>  multipathd/cli.c          |   8 +++
>  multipathd/cli.h          |   8 +++
>  multipathd/cli_handlers.c |  82 +++++++++++++++++++++++
>  multipathd/cli_handlers.h |   3 +
>  multipathd/main.c         |   3 +
>  15 files changed, 388 insertions(+), 20 deletions(-)
>  create mode 100644 libmultipath/prkey.c
>  create mode 100644 libmultipath/prkey.h

Looks ok to me. I suppose you tested that parsing code for the key file.
Reviewed-by: Martin Wilck <mwilck@suse.com>

-- 
Dr. Martin Wilck <mwilck@suse.com>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)

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

  reply	other threads:[~2017-09-08 21:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-08 18:45 [PATCH 0/5] multipath: alternative reservation_key method Benjamin Marzinski
2017-09-08 18:45 ` [PATCH 1/5] libmultipath: pull functions into util.c Benjamin Marzinski
2017-09-08 20:51   ` Martin Wilck
2017-09-08 18:45 ` [PATCH 2/5] libmultipath: change reservation_key to a uint64_t Benjamin Marzinski
2017-09-08 21:09   ` Martin Wilck
2017-09-08 22:55     ` Benjamin Marzinski
2017-09-08 18:45 ` [PATCH 3/5] libmpathpersist: fix update_prflag code Benjamin Marzinski
2017-09-08 21:17   ` Martin Wilck
2017-09-08 18:45 ` [PATCH 4/5] multipath: add alternate reservation_key method Benjamin Marzinski
2017-09-08 21:34   ` Martin Wilck [this message]
2017-09-08 23:00     ` Benjamin Marzinski
2017-09-13 15:22   ` Xose Vazquez Perez
2017-09-08 18:45 ` [PATCH 5/5] mpathpersist: add support for prkeys file Benjamin Marzinski
2017-09-08 21:35   ` 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=1504906488.4585.31.camel@suse.com \
    --to=mwilck@suse.com \
    --cc=bmarzins@redhat.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 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.