From: Mike Snitzer <snitzer@redhat.com>
To: Hannes Reinecke <hare@suse.de>
Cc: dm-devel@redhat.com, Babu Moger <babu.moger@netapp.com>
Subject: Re: [PATCH 3/3] dm-multipath: 'default_hw_handler' feature
Date: Tue, 8 May 2012 10:46:54 -0400 [thread overview]
Message-ID: <20120508144653.GF8383@redhat.com> (raw)
In-Reply-To: <1336486687-31535-4-git-send-email-hare@suse.de>
On Tue, May 08 2012 at 10:18am -0400,
Hannes Reinecke <hare@suse.de> wrote:
> This patch introduces a 'default_hw_handler' feature for
> dm-mpath. When specifying the feature 'default_hw_handler'
> dm-multipath will be using the currently attached hardware
> handler instead of trying to re-attach with the one
> specified during table creation.
> If no hardware handler is attached the specified hardware
> handler will be used.
>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
> drivers/md/dm-mpath.c | 25 ++++++++++++++++++++++---
> 1 files changed, 22 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
> index 6d3f2a8..c1ef41d 100644
> --- a/drivers/md/dm-mpath.c
> +++ b/drivers/md/dm-mpath.c
> @@ -57,6 +57,7 @@ struct priority_group {
> };
>
> #define FEATURE_NO_PARTITIONS 1
> +#define FEATURE_DEFAULT_HW_HANDLER 2
>
> /* Multipath context */
> struct multipath {
> @@ -589,14 +590,24 @@ static struct pgpath *parse_path(struct dm_arg_set *as, struct path_selector *ps
>
> if (m->hw_handler_name) {
> struct request_queue *q = bdev_get_queue(p->path.dev->bdev);
> + const char *hw_handler_name = m->hw_handler_name;
>
> - r = scsi_dh_attach(q, m->hw_handler_name);
> + if (m->features & FEATURE_DEFAULT_HW_HANDLER)
> + hw_handler_name = NULL;
> +
> + r = scsi_dh_attach(q, hw_handler_name);
> if (r == -EBUSY) {
> /*
> * Already attached to different hw_handler,
> * try to reattach with correct one.
> */
> scsi_dh_detach(q);
> + r = scsi_dh_attach(q, hw_handler_name);
> + } else if (r == -EINVAL) {
> + /*
> + * No hardware handler attached, use
> + * the specified one.
> + */
> r = scsi_dh_attach(q, m->hw_handler_name);
> }
I like what you've done with the 'default_hw_handler' feature. But
you're not establishing m->hw_handler_name. As such the rest of the
dm-mpath.c code that keys off of m->hw_handler_name (e.g. reinstate_path,
pg_init_done, free_pgpaths) will not work.
Would you be OK with a hybrid of both our approaches? Use your
'default_hw_handler' feature and, rather than pass a NULL name to
scsi_dh_attach, use scsi_dh_attached_handler_name like I provided?
(I don't see a problem with altering m->hw_handler_name to reflect the
scsi_dh that is used by the path.. Babu agreed with this too).
I'd be happy to merge our dm-mpath patches and attribute authorship to
you.
Mike
next prev parent reply other threads:[~2012-05-08 14:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-08 14:18 [RFC] [PATCH 0/3] dm-multipath: New features Hannes Reinecke
2012-05-08 14:18 ` [PATCH 1/3] scsi_dh: Allow NULL hardware handler name in scsi_dh_attach() Hannes Reinecke
2012-05-08 14:18 ` [PATCH 2/3] dm-multipath: disable partition scan feature Hannes Reinecke
2012-05-08 14:18 ` [PATCH 3/3] dm-multipath: 'default_hw_handler' feature Hannes Reinecke
2012-05-08 14:46 ` Mike Snitzer [this message]
2012-05-08 17:30 ` Hannes Reinecke
2012-05-08 17:56 ` Moger, Babu
2012-05-08 21:12 ` Chandra Seetharaman
2012-05-08 14:27 ` [PATCH 1/3] scsi_dh: Allow NULL hardware handler name in scsi_dh_attach() Mike Snitzer
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=20120508144653.GF8383@redhat.com \
--to=snitzer@redhat.com \
--cc=babu.moger@netapp.com \
--cc=dm-devel@redhat.com \
--cc=hare@suse.de \
/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.