From: Christophe Varoqui <christophe.varoqui@gmail.com>
To: device-mapper development <dm-devel@redhat.com>
Subject: Re: multipath-tools libmultipath/config.h libmulti ...
Date: Sat, 24 Apr 2010 09:29:58 +0200 [thread overview]
Message-ID: <1272094198.8221.1.camel@localhost> (raw)
In-Reply-To: <20100424052813.1042.qmail@sourceware.org>
Hi Ben,
you have a spelling error in the help message (nor/not).
I like this approach better indeed.
Bye
On sam., 2010-04-24 at 05:28 +0000, bmarzins@sourceware.org wrote:
> CVSROOT: /cvs/dm
> Module name: multipath-tools
> Branch: RHEL5_FC6
> Changes by: bmarzins@sourceware.org 2010-04-24 05:28:07
>
> Modified files:
> libmultipath : config.h configure.c
> multipath : main.c
>
> Log message:
> Changed the fix for 579789. Multipath now checks if multipathd is running and
> automatically acts accordingly by default. The -q option overrides this.
>
> Patches:
> http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/config.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.18.2.10&r2=1.18.2.11
> http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/configure.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.2.2.7&r2=1.2.2.8
> http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.44.2.9&r2=1.44.2.10
>
> --- multipath-tools/libmultipath/config.h 2010/04/08 19:31:49 1.18.2.10
> +++ multipath-tools/libmultipath/config.h 2010/04/24 05:28:06 1.18.2.11
> @@ -78,7 +78,7 @@
> int flush_on_last_del;
> int queue_without_daemon;
> int checker_timeout;
> - int override_queueing;
> + int allow_queueing;
> uid_t uid;
> gid_t gid;
> mode_t mode;
> --- multipath-tools/libmultipath/configure.c 2010/04/08 19:31:49 1.2.2.7
> +++ multipath-tools/libmultipath/configure.c 2010/04/24 05:28:06 1.2.2.8
> @@ -13,6 +13,7 @@
> #include <sys/file.h>
> #include <errno.h>
> #include <libdevmapper.h>
> +#include <fcntl.h>
>
> #include <checkers.h>
>
> @@ -438,6 +439,35 @@
> return 1; /* dead */
> }
>
> +int
> +pidfile_check(const char *file)
> +{
> + int fd;
> + struct flock lock;
> +
> + fd = open(file, O_RDONLY);
> + if (fd < 0) {
> + if (errno == ENOENT)
> + return 0;
> + condlog(0, "Cannot open pidfile, %s : %s", file,
> + strerror(errno));
> + return -1;
> + }
> + lock.l_type = F_WRLCK;
> + lock.l_start = 0;
> + lock.l_whence = SEEK_SET;
> + lock.l_len = 0;
> +
> + if (fcntl(fd, F_GETLK, &lock) < 0) {
> + condlog(0, "Cannot check lock on pidfile, %s : %s", file,
> + strerror(errno));
> + return -1;
> + }
> + if (lock.l_type == F_UNLCK)
> + return 0;
> + return 1;
> +}
> +
> extern int
> coalesce_paths (struct vectors * vecs, vector newmp, char * refwwid)
> {
> @@ -536,15 +566,17 @@
> }
> if (r == DOMAP_DRY)
> continue;
> -
> - if (conf->override_queueing)
> +#ifndef DAEMON
> + if (!conf->allow_queueing && !pidfile_check(DEFAULT_PIDFILE))
> dm_queue_if_no_path(mpp->alias, 0);
> - else if (mpp->no_path_retry != NO_PATH_RETRY_UNDEF) {
> - if (mpp->no_path_retry == NO_PATH_RETRY_FAIL)
> - dm_queue_if_no_path(mpp->alias, 0);
> - else
> - dm_queue_if_no_path(mpp->alias, 1);
> - }
> + else
> +#endif
> + if (mpp->no_path_retry != NO_PATH_RETRY_UNDEF) {
> + if (mpp->no_path_retry == NO_PATH_RETRY_FAIL)
> + dm_queue_if_no_path(mpp->alias, 0);
> + else
> + dm_queue_if_no_path(mpp->alias, 1);
> + }
> if (mpp->pg_timeout != PGTIMEOUT_UNDEF) {
> if (mpp->pg_timeout == -PGTIMEOUT_NONE)
> dm_set_pg_timeout(mpp->alias, 0);
> --- multipath-tools/multipath/main.c 2010/04/16 22:08:03 1.44.2.9
> +++ multipath-tools/multipath/main.c 2010/04/24 05:28:06 1.44.2.10
> @@ -1,7 +1,7 @@
> /*
> * Soft: multipath device mapper target autoconfig
> *
> - * Version: $Id: main.c,v 1.44.2.9 2010/04/16 22:08:03 bmarzins Exp $
> + * Version: $Id: main.c,v 1.44.2.10 2010/04/24 05:28:06 bmarzins Exp $
> *
> * Author: Christophe Varoqui
> *
> @@ -72,7 +72,7 @@
> usage (char * progname)
> {
> fprintf (stderr, VERSION_STRING);
> - fprintf (stderr, "Usage: %s\t[-v level] [-d] [-h|-l|-ll|-f|-F|-r]\n",
> + fprintf (stderr, "Usage: %s\t[-v level] [-d] [-h|-l|-ll|-f|-F|-r|-q]\n",
> progname);
> fprintf (stderr,
> "\t\t\t[-p failover|multibus|group_by_serial|group_by_prio]\n" \
> @@ -84,7 +84,7 @@
> "\t 2\t\t\tdefault verbosity\n" \
> "\t 3\t\t\tprint debug information\n" \
> "\t-h\t\tprint this usage text\n" \
> - "\t-q\t\tforce all maps to turn off queue_if_no_path\n"\
> + "\t-q\t\tallow queue_if_no_path when multipathd is nor running\n"\
> "\t-b file\t\tbindings file location\n" \
> "\t-d\t\tdry run, do not create or update devmaps\n" \
> "\t-l\t\tshow multipath topology (sysfs and DM info)\n" \
> @@ -337,7 +337,7 @@
> conf->verbosity = atoi(optarg);
> break;
> case 'q':
> - conf->override_queueing = 1;
> + conf->allow_queueing = 1;
> break;
> case 'b':
> if (conf->bindings_file)
>
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
next prev parent reply other threads:[~2010-04-24 7:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-24 5:28 multipath-tools libmultipath/config.h libmulti bmarzins
2010-04-24 7:29 ` Christophe Varoqui [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-09-08 21:40 bmarzins
2008-08-22 21:55 bmarzins
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=1272094198.8221.1.camel@localhost \
--to=christophe.varoqui@gmail.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;
as well as URLs for NNTP newsgroup(s).