All of lore.kernel.org
 help / color / mirror / Atom feed
From: Malahal Naineni <malahal@us.ibm.com>
To: dm-devel@redhat.com
Subject: Re: multipath: change the DEFAULT_MINIO for the request based multipath
Date: Tue, 1 Feb 2011 00:13:03 -0800	[thread overview]
Message-ID: <20110201081303.GA31174@us.ibm.com> (raw)
In-Reply-To: <1296518031.6483.106.camel@zezette>

>Christophe Varoqui [christophe.varoqui@gmail.com] wrote:

>+dm_drv_get_rq (void)
>+{
>+	unsigned int minv_dmrq[3] = {1, 1, 0};
>+	unsigned int *v;
>+
>+	v = zalloc(3);
>+	if (!v)
>+		return 0;
>+
>+	if (dm_drv_version(v, TGT_MPATH)) {
>+		/* in doubt return least capable */
>+		return 0;
>+	}

Looks like the 'v' is NOT freed. Local stack allocation looks much
cleaner, why not do that? You missed the same thing at other places, so
I imagine you started with the on stack local structure but changed
later???

>+static int
>+dm_drvprereq (char * str)
>+{
>+	unsigned int minv[3] = {1, 0, 3};
>+	unsigned int *v;
>+
>+	v = zalloc(3);
>+	if (!v)
>+		return 0;
>+
>+	if (dm_drv_version(v, str)) {
>+		/* in doubt return not capable */
>+		return 1;
>+	}

Missed freeing 'v'. Also, this function taking the target driver name as
'str' doesn't make sense as the minimum version is hard coded internally
to this function. Take no arguments and pass 'TGT_MPATH' while calling
dm_drv_version.

> static int
>+def_minio_rq_handler(vector strvec)
>+{
>+	char * buff;
>+
>+	buff = set_value(strvec);
>+
>+	if (!buff)
>+		return 1;
>+
>+	conf->minio_rq = atoi(buff);
>+	FREE(buff);
>+
>+	return 0;
>+}

I was thinking why introduce minio and minio_rq in the
/etc/multipath.conf file. By default we ship empty /etc/multipath.conf
file. If the admin wants to override the default, he knows if he is
going to use the BIO or REQUEST based multipath. So here is my approach
to avoid introducing another similar looking config keyword:

If we detect minio setting from the config file (either in the
multipath, device or default section), we use it. The code internally
has minio_rq just as you did. In other words, the only change I am
proposing is, use the existing routines that handle minio keyword and
set minio_rq there.

E.g: def_minio_handler() will set conf->minio_rq = conf->minio
hw_minio_handler() will set hwe->minio_rq = hwe->minio
mp_minio_handler() will set mpe->minio_rq = mpe->minio

Thanks, Malahal.

  parent reply	other threads:[~2011-02-01  8:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-19 21:30 [PATCH] [RFC] multipath: change the DEFAULT_MINIO for the request based multipath Malahal Naineni
2011-01-20  7:32 ` Hannes Reinecke
2011-01-20 16:07   ` Mike Snitzer
2011-01-21  7:03     ` Jun'ichi Nomura
2011-01-21  8:47       ` Christophe Varoqui
2011-01-21 14:12         ` Mike Snitzer
2011-01-21 14:46           ` Christophe Varoqui
2011-01-21 17:39             ` Malahal Naineni
2011-01-25  8:56               ` Jun'ichi Nomura
2011-01-26  2:23                 ` Malahal Naineni
2011-01-26 17:27                   ` nishant mungse
2011-01-27 15:16                     ` nishant mungse
2011-01-31 23:53                   ` Christophe Varoqui
2011-02-01  2:21                     ` Malahal Naineni
2011-02-01  3:13                       ` Mike Snitzer
2011-02-01  8:14                         ` Malahal Naineni
2011-02-01  8:13                     ` Malahal Naineni [this message]
2011-02-01  9:00                       ` Christophe Varoqui
2011-02-01  9:51                         ` Malahal Naineni
2011-01-21 13:26       ` 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=20110201081303.GA31174@us.ibm.com \
    --to=malahal@us.ibm.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.