All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: dm-devel@redhat.com
Subject: dm-multipath [PATCH] multipathd adding devices.
Date: Fri, 24 Feb 2006 20:33:29 -0600	[thread overview]
Message-ID: <20060225023329.GB18957@ether.msp.redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 281 bytes --]

The way multipathd currently works, if you add a map that isn't known to
device mapper from multipathd, the first time you run the command, it won't
add the map to the mpvec vector.  With the attached patch, multipathd will
initialize the map and add it to the mpvec vector.

-Ben

[-- Attachment #2: add_map.patch --]
[-- Type: text/plain, Size: 1246 bytes --]

diff -urpN mp-devel-clean/multipathd/main.c mp-devel-patched/multipathd/main.c
--- mp-devel-clean/multipathd/main.c	2006-02-23 17:33:58.000000000 -0600
+++ mp-devel-patched/multipathd/main.c	2006-02-24 21:16:17.000000000 -0600
@@ -550,6 +550,7 @@ ev_add_map (char * devname, struct vecto
 	char * alias;
 	char * refwwid;
 	struct multipath * mpp;
+	vector mpvec;
 	int map_present;
 	int r = 1;
 
@@ -597,10 +598,33 @@ ev_add_map (char * devname, struct vecto
 	refwwid = get_refwwid(devname, DEV_DEVMAP, vecs->pathvec);
 
 	if (refwwid) {
-		r = coalesce_paths(vecs, NULL, refwwid);
+		int i;
+		if (!(mpvec = vector_alloc()))
+			goto out;
+		r = coalesce_paths(vecs, mpvec, refwwid);
 		dm_lib_release();
+		if (r)
+			goto out_free;
+		r = 1;
+		vector_foreach_slot(mpvec, mpp, i){
+			if (!vector_alloc_slot(vecs->mpvec)) {
+				orphan_paths(vecs->pathvec, mpp);
+				free_multipath(mpp, KEEP_PATHS);
+				goto out_free;
+			}
+			vector_set_slot(vecs->mpvec, mpp);
+			sync_map_state(mpp);
+			if (setup_multipath(vecs, mpp))
+				goto out_free;
+			if (start_waiter_thread(mpp, vecs))
+				goto out_free;
+			r = 0;
+		}
 	}
 	
+out_free:
+	vector_free(mpvec);
+out:
 	if (!r)
 		condlog(3, "%s: devmap %s added", alias, devname);
 	else

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



             reply	other threads:[~2006-02-25  2:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-25  2:33 Benjamin Marzinski [this message]
2006-03-02 11:09 ` dm-multipath [PATCH] multipathd adding devices Christophe Varoqui
2006-03-02 15:41   ` Christophe Varoqui
  -- strict thread matches above, loose matches on Subject: below --
2006-03-02 16:28 egoggin
2006-03-02 16:38 ` Christophe Varoqui

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=20060225023329.GB18957@ether.msp.redhat.com \
    --to=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.