* multipath-tools/multipathd main.c
@ 2012-03-22 18:02 bmarzins
0 siblings, 0 replies; 17+ messages in thread
From: bmarzins @ 2012-03-22 18:02 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: bmarzins@sourceware.org 2012-03-22 18:02:34
Modified files:
multipathd : main.c
Log message:
Fix for bz803849. applying patch from John Ruemker. multipathd was not
correctly unmounting all unnecessary devices from its private namespace.
Not applicable upstream.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.69.2.39&r2=1.69.2.40
--- multipath-tools/multipathd/main.c 2011/10/27 21:36:20 1.69.2.39
+++ multipath-tools/multipathd/main.c 2012/03/22 18:02:34 1.69.2.40
@@ -1377,17 +1377,27 @@
{
char buf[LINE_MAX];
FILE *file;
+ vector extra_devs;
+ char *slot;
+ int s;
file = fopen("/proc/mounts", "r");
if (!file) {
condlog(0, "couldn't open /proc/mounts : %s", strerror(errno));
return -1;
}
+
+ extra_devs = vector_alloc();
+ if (!extra_devs) {
+ condlog(0, "couldn't allocate vector for extra devs\n");
+ return -1;
+ }
+
find_keep_dirs();
while (fgets(buf, LINE_MAX, file)) {
int i;
char *keep;
- char *end, *mnt = strchr(buf, ' ');
+ char *end, *extra, *mnt = strchr(buf, ' ');
if (!mnt)
continue;
mnt++;
@@ -1418,13 +1428,26 @@
strncmp(mnt, "/lib64", 6) == 0 || strncmp(mnt, "/usr/lib64", 10) == 0 ||
strncmp(mnt, "/ram", 4) == 0)
continue;
- if (umount2(mnt, MNT_DETACH) < 0 && errno != ENOENT)
- condlog(0, "failed to umount '%s' (%s). skipping", mnt,
- strerror(errno));
+ if (!vector_alloc_slot(extra_devs)) {
+ condlog(2, "couldn't allocate vector slot for extra dev (%s). "
+ "skipping,", mnt);
+ continue;
+ }
+ extra = strdup(mnt);
+ vector_set_slot(extra_devs, extra);
next:
;
}
fclose(file);
+
+ vector_foreach_slot(extra_devs, slot, s) {
+ if (umount2(slot, MNT_DETACH) < 0 && errno != ENOENT) {
+ condlog(0, "failed to umount '%s' (%s). skipping",
+ slot, strerror(errno));
+ }
+ free(slot);
+ }
+ vector_free(extra_devs);
return 0;
}
^ permalink raw reply [flat|nested] 17+ messages in thread
* multipath-tools/multipathd main.c
@ 2012-08-10 18:49 bmarzins
0 siblings, 0 replies; 17+ messages in thread
From: bmarzins @ 2012-08-10 18:49 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: bmarzins@sourceware.org 2012-08-10 18:49:10
Modified files:
multipathd : main.c
Log message:
Fix for bz #833193. Make sure multipathd removes directories named /dev<foo>
Not applicable upstream.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.69.2.43&r2=1.69.2.44
--- multipath-tools/multipathd/main.c 2012/08/07 19:37:51 1.69.2.43
+++ multipath-tools/multipathd/main.c 2012/08/10 18:49:09 1.69.2.44
@@ -1424,10 +1424,10 @@
strcmp(mnt, "/bin") == 0 || strcmp(mnt, "/tmp") == 0 ||
strcmp(mnt, "/usr") == 0 || strncmp(mnt, "/usr/lib", 8) == 0 ||
strcmp(mnt, "/etc") == 0 || strncmp(mnt, "/proc", 5) == 0 ||
- strncmp(mnt, "/dev", 4) == 0 || strncmp(mnt, "/sys", 4) == 0 ||
+ strcmp(mnt, "/dev") == 0 || strncmp(mnt, "/sys", 4) == 0 ||
strcmp(mnt, "/var") == 0 || strcmp(mnt, "/var/lib") == 0 ||
strcmp(mnt, "/var/lib/multipath") == 0 ||
- strcmp(mnt, CALLOUT_DIR) == 0 ||
+ strncmp(mnt, "/dev/", 5) == 0 || strcmp(mnt, CALLOUT_DIR) == 0 ||
strncmp(mnt, "/var/run", 8) == 0 || strncmp(mnt, "/lib", 4) == 0 ||
strncmp(mnt, "/lib64", 6) == 0 || strncmp(mnt, "/usr/lib64", 10) == 0 ||
strncmp(mnt, "/ram", 4) == 0)
^ permalink raw reply [flat|nested] 17+ messages in thread
* multipath-tools/multipathd main.c
@ 2012-08-07 19:37 bmarzins
0 siblings, 0 replies; 17+ messages in thread
From: bmarzins @ 2012-08-07 19:37 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: bmarzins@sourceware.org 2012-08-07 19:37:51
Modified files:
multipathd : main.c
Log message:
Fix for bz #843626. Make sure multipathd doesn't remove the
/var/cache/multipathd directory. Not applicable upstream.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.69.2.42&r2=1.69.2.43
--- multipath-tools/multipathd/main.c 2012/07/11 23:03:34 1.69.2.42
+++ multipath-tools/multipathd/main.c 2012/08/07 19:37:51 1.69.2.43
@@ -1427,6 +1427,7 @@
strncmp(mnt, "/dev", 4) == 0 || strncmp(mnt, "/sys", 4) == 0 ||
strcmp(mnt, "/var") == 0 || strcmp(mnt, "/var/lib") == 0 ||
strcmp(mnt, "/var/lib/multipath") == 0 ||
+ strcmp(mnt, CALLOUT_DIR) == 0 ||
strncmp(mnt, "/var/run", 8) == 0 || strncmp(mnt, "/lib", 4) == 0 ||
strncmp(mnt, "/lib64", 6) == 0 || strncmp(mnt, "/usr/lib64", 10) == 0 ||
strncmp(mnt, "/ram", 4) == 0)
^ permalink raw reply [flat|nested] 17+ messages in thread
* multipath-tools/multipathd main.c
@ 2011-10-24 13:46 bmarzins
0 siblings, 0 replies; 17+ messages in thread
From: bmarzins @ 2011-10-24 13:46 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: bmarzins@sourceware.org 2011-10-24 13:46:54
Modified files:
multipathd : main.c
Log message:
fix for bz #741664. setup_multipath frees the multipath device if it fails,
so check the return value, and don't touch the multipath device, it
setup_multipath() has returned 1.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.69.2.37&r2=1.69.2.38
--- multipath-tools/multipathd/main.c 2011/10/10 04:15:41 1.69.2.37
+++ multipath-tools/multipathd/main.c 2011/10/24 13:46:54 1.69.2.38
@@ -988,7 +988,8 @@
return 1;
}
dm_lib_release();
- setup_multipath(vecs, mpp);
+ if (setup_multipath(vecs, mpp) != 0)
+ return 1;
sync_map_state(mpp);
return 0;
^ permalink raw reply [flat|nested] 17+ messages in thread
* multipath-tools/multipathd main.c
@ 2011-10-10 3:47 bmarzins
0 siblings, 0 replies; 17+ messages in thread
From: bmarzins @ 2011-10-10 3:47 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: bmarzins@sourceware.org 2011-10-10 03:47:07
Modified files:
multipathd : main.c
Log message:
Fix for BZ# 655976. Don't automatically update path groups on devices set to
manual failback when the prio changes. This fix is already upstream.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.69.2.35&r2=1.69.2.36
--- multipath-tools/multipathd/main.c 2011/04/11 17:01:08 1.69.2.35
+++ multipath-tools/multipathd/main.c 2011/10/10 03:47:07 1.69.2.36
@@ -1153,8 +1153,7 @@
* path prio refreshing
*/
condlog(4, "path prio refresh");
- if (update_prio(pp, new_path_up) &&
- pp->mpp->pgpolicyfn == (pgpolicyfn *)group_by_prio)
+ if (update_prio(pp, new_path_up) && pp->mpp->pgpolicyfn == (pgpolicyfn *)group_by_prio && (pp->mpp->pgfailback == -FAILBACK_IMMEDIATE || pp->mpp->pgfailback > 0))
update_path_groups(pp->mpp, vecs, !new_path_up);
else if (need_switch_pathgroup(pp->mpp, 0)) {
if (pp->mpp->pgfailback > 0 &&
^ permalink raw reply [flat|nested] 17+ messages in thread
* multipath-tools/multipathd main.c
@ 2011-04-11 17:01 bmarzins
0 siblings, 0 replies; 17+ messages in thread
From: bmarzins @ 2011-04-11 17:01 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: bmarzins@sourceware.org 2011-04-11 17:01:08
Modified files:
multipathd : main.c
Log message:
Oops. stray semi-colon.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.69.2.34&r2=1.69.2.35
--- multipath-tools/multipathd/main.c 2011/04/04 19:48:46 1.69.2.34
+++ multipath-tools/multipathd/main.c 2011/04/11 17:01:08 1.69.2.35
@@ -1505,7 +1505,7 @@
condlog(2, "reconfigure (SIGHUP)");
lock(gvecs->lock);
- if (!exitting);
+ if (!exitting)
reconfigure(gvecs);
unlock(gvecs->lock);
^ permalink raw reply [flat|nested] 17+ messages in thread
* multipath-tools/multipathd main.c
@ 2010-12-07 6:02 bmarzins
0 siblings, 0 replies; 17+ messages in thread
From: bmarzins @ 2010-12-07 6:02 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: bmarzins@sourceware.org 2010-12-07 06:02:24
Modified files:
multipathd : main.c
Log message:
Fix for bug 650801. Multipathd wasn't checking checking all the paths to see
if it needed to update the pathgroups after a new path came back online.
This could lead to paths accidentally ending up in the wrong pathgroup.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.69.2.30&r2=1.69.2.31
--- multipath-tools/multipathd/main.c 2010/09/08 21:40:30 1.69.2.30
+++ multipath-tools/multipathd/main.c 2010/12/07 06:02:23 1.69.2.31
@@ -937,14 +937,41 @@
return 0;
}
-int update_path_groups(struct multipath *mpp, struct vectors *vecs)
+int update_prio(struct path *pp, int refresh_all)
+{
+ int oldpriority;
+ struct pathgroup * pgp;
+ int i, j, changed = 0;
+
+ if (refresh_all) {
+ vector_foreach_slot (pp->mpp->pg, pgp, i) {
+ vector_foreach_slot (pgp->paths, pp, j) {
+ oldpriority = pp->priority;
+ pathinfo(pp, conf->hwtable, DI_PRIO);
+ if (pp->priority != oldpriority)
+ changed = 1;
+ }
+ }
+ return changed;
+ }
+ oldpriority = pp->priority;
+ pathinfo(pp, conf->hwtable, DI_PRIO);
+
+ if (pp->priority == oldpriority)
+ return 0;
+ return 1;
+}
+
+int update_path_groups(struct multipath *mpp, struct vectors *vecs, int refresh)
{
int i;
struct path * pp;
update_mpp_paths(mpp, vecs->pathvec);
- vector_foreach_slot (mpp->paths, pp, i)
- pathinfo(pp, conf->hwtable, DI_PRIO);
+ if (refresh) {
+ vector_foreach_slot (mpp->paths, pp, i)
+ pathinfo(pp, conf->hwtable, DI_PRIO);
+ }
setup_map(mpp);
mpp->action = ACT_RELOAD;
if (domap(mpp) <= 0) {
@@ -969,7 +996,6 @@
int newstate;
unsigned int i;
sigset_t old;
- int oldpriority;
mlockall(MCL_CURRENT | MCL_FUTURE);
vecs = (struct vectors *)ap;
@@ -989,6 +1015,7 @@
condlog(4, "tick");
vector_foreach_slot (vecs->pathvec, pp, i) {
+ int new_path_up = 0;
if (!pp->mpp)
continue;
@@ -1081,16 +1108,7 @@
reinstate_path(pp, 1);
else
reinstate_path(pp, 0);
-
- /*
- * schedule [defered] failback
- */
- if (pp->mpp->pgfailback > 0)
- pp->mpp->failback_tick =
- pp->mpp->pgfailback + 1;
- else if (pp->mpp->pgfailback == -FAILBACK_IMMEDIATE &&
- need_switch_pathgroup(pp->mpp, 1))
- switch_pathgroup(pp->mpp);
+ new_path_up = 1;
/*
* if at least one path is up in a group, and
@@ -1127,15 +1145,13 @@
* path prio refreshing
*/
condlog(4, "path prio refresh");
- oldpriority = pp->priority;
- pathinfo(pp, conf->hwtable, DI_PRIO);
-
- if (pp->priority != oldpriority &&
+ if (update_prio(pp, new_path_up) &&
pp->mpp->pgpolicyfn == (pgpolicyfn *)group_by_prio)
- update_path_groups(pp->mpp, vecs);
+ update_path_groups(pp->mpp, vecs, !new_path_up);
else if (need_switch_pathgroup(pp->mpp, 0)) {
if (pp->mpp->pgfailback > 0 &&
- pp->mpp->failback_tick <= 0)
+ (new_path_up ||
+ pp->mpp->failback_tick <= 0))
pp->mpp->failback_tick =
pp->mpp->pgfailback + 1;
else if (pp->mpp->pgfailback ==
^ permalink raw reply [flat|nested] 17+ messages in thread
* multipath-tools/multipathd main.c
@ 2010-09-01 18:29 bmarzins
0 siblings, 0 replies; 17+ messages in thread
From: bmarzins @ 2010-09-01 18:29 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: bmarzins@sourceware.org 2010-09-01 18:29:19
Modified files:
multipathd : main.c
Log message:
Fix for bz #566685. Multipathd now will reload the device if it notices that
the priorities have changed during the checkerloop.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.69.2.28&r2=1.69.2.29
--- multipath-tools/multipathd/main.c 2010/08/09 16:16:10 1.69.2.28
+++ multipath-tools/multipathd/main.c 2010/09/01 18:29:18 1.69.2.29
@@ -52,6 +52,7 @@
#include <switchgroup.h>
#include <print.h>
#include <configure.h>
+#include <pgpolicies.h>
#include "main.h"
#include "pidfile.h"
@@ -933,6 +934,29 @@
return 0;
}
+int update_path_groups(struct multipath *mpp, struct vectors *vecs)
+{
+ int i;
+ struct path * pp;
+
+ update_mpp_paths(mpp, vecs->pathvec);
+ vector_foreach_slot (mpp->paths, pp, i)
+ pathinfo(pp, conf->hwtable, DI_PRIO);
+ setup_map(mpp);
+ mpp->action = ACT_RELOAD;
+ if (domap(mpp) <= 0) {
+ condlog(0, "%s: failed to update map : %s", mpp->alias,
+ strerror(errno));
+ return 1;
+ }
+ dm_lib_release();
+ setup_multipath(vecs, mpp);
+ sync_map_state(mpp);
+
+ return 0;
+}
+
+
static void *
checkerloop (void *ap)
{
@@ -942,6 +966,7 @@
int newstate;
unsigned int i;
sigset_t old;
+ int oldpriority;
mlockall(MCL_CURRENT | MCL_FUTURE);
vecs = (struct vectors *)ap;
@@ -1095,9 +1120,13 @@
* path prio refreshing
*/
condlog(4, "path prio refresh");
+ oldpriority = pp->priority;
pathinfo(pp, conf->hwtable, DI_PRIO);
- if (need_switch_pathgroup(pp->mpp, 0)) {
+ if (pp->priority != oldpriority &&
+ pp->mpp->pgpolicyfn == (pgpolicyfn *)group_by_prio)
+ update_path_groups(pp->mpp, vecs);
+ else if (need_switch_pathgroup(pp->mpp, 0)) {
if (pp->mpp->pgfailback > 0 &&
pp->mpp->failback_tick <= 0)
pp->mpp->failback_tick =
^ permalink raw reply [flat|nested] 17+ messages in thread
* multipath-tools/multipathd main.c
@ 2010-08-09 16:16 bmarzins
0 siblings, 0 replies; 17+ messages in thread
From: bmarzins @ 2010-08-09 16:16 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: bmarzins@sourceware.org 2010-08-09 16:16:10
Modified files:
multipathd : main.c
Log message:
Fix for bz #614966
Occasionally, the kernel sends out remove uevents when the multipath device
hasn't been removed. multipathd should never remove the device when it gets
these events, since they are only suspposed to be generated after the device
has already been removed.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.69.2.27&r2=1.69.2.28
--- multipath-tools/multipathd/main.c 2010/06/23 16:28:08 1.69.2.27
+++ multipath-tools/multipathd/main.c 2010/08/09 16:16:10 1.69.2.28
@@ -299,8 +299,18 @@
static int
uev_remove_map (char * devname, struct vectors * vecs)
{
+ struct multipath * mpp;
+
condlog(2, "%s: remove map (uevent)", devname);
- return ev_remove_map(devname, vecs);
+
+ mpp = find_mp_by_str(vecs->mpvec, devname);
+ if (!mpp) {
+ condlog(2, "%s: devmap not registered, can't remove", devname);
+ return 0;
+ }
+ orphan_paths(vecs->pathvec, mpp);
+ remove_map(mpp, vecs, stop_waiter_thread, 1);
+ return 0;
}
int
^ permalink raw reply [flat|nested] 17+ messages in thread
* multipath-tools/multipathd main.c
@ 2009-11-02 19:11 bmarzins
0 siblings, 0 replies; 17+ messages in thread
From: bmarzins @ 2009-11-02 19:11 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: bmarzins@sourceware.org 2009-11-02 19:11:46
Modified files:
multipathd : main.c
Log message:
Fixed typo in unmounting unnecessary devices from multipathd's private
namespace. Related to bz #532424. Not applicable upstream.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.69.2.24&r2=1.69.2.25
--- multipath-tools/multipathd/main.c 2009/09/10 16:27:24 1.69.2.24
+++ multipath-tools/multipathd/main.c 2009/11/02 19:11:46 1.69.2.25
@@ -1289,7 +1289,7 @@
strcmp(mnt, "/etc") == 0 || strncmp(mnt, "/proc", 5) == 0 ||
strncmp(mnt, "/dev", 4) == 0 || strncmp(mnt, "/sys", 4) == 0 ||
strcmp(mnt, "/var") == 0 || strncmp(mnt, "/var/lib", 8) == 0 ||
- strncmp(mnt, "/var/run", 8) || strncmp(mnt, "/lib", 4) == 0 ||
+ strncmp(mnt, "/var/run", 8) == 0 || strncmp(mnt, "/lib", 4) == 0 ||
strncmp(mnt, "/lib64", 6) == 0 || strncmp(mnt, "/usr/lib64", 10) == 0)
continue;
if (umount2(mnt, MNT_DETACH) < 0 && errno != ENOENT) {
^ permalink raw reply [flat|nested] 17+ messages in thread
* multipath-tools/multipathd main.c
@ 2009-09-10 16:27 bmarzins
0 siblings, 0 replies; 17+ messages in thread
From: bmarzins @ 2009-09-10 16:27 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: bmarzins@sourceware.org 2009-09-10 16:27:24
Modified files:
multipathd : main.c
Log message:
The only /var subdirectories that multipathd needs in its private namespace are
/var/lib and /var/run. Drop the others. Not Applicable upstream.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.69.2.23&r2=1.69.2.24
--- multipath-tools/multipathd/main.c 2009/08/19 21:52:40 1.69.2.23
+++ multipath-tools/multipathd/main.c 2009/09/10 16:27:24 1.69.2.24
@@ -1288,9 +1288,9 @@
strcmp(mnt, "/usr") == 0 || strncmp(mnt, "/usr/lib", 8) == 0 ||
strcmp(mnt, "/etc") == 0 || strncmp(mnt, "/proc", 5) == 0 ||
strncmp(mnt, "/dev", 4) == 0 || strncmp(mnt, "/sys", 4) == 0 ||
- strncmp(mnt, "/var", 4) == 0 || strncmp(mnt, "/lib", 4) == 0 ||
- strncmp(mnt, "/lib64", 6) == 0 ||
- strncmp(mnt, "/usr/lib64", 10) == 0)
+ strcmp(mnt, "/var") == 0 || strncmp(mnt, "/var/lib", 8) == 0 ||
+ strncmp(mnt, "/var/run", 8) || strncmp(mnt, "/lib", 4) == 0 ||
+ strncmp(mnt, "/lib64", 6) == 0 || strncmp(mnt, "/usr/lib64", 10) == 0)
continue;
if (umount2(mnt, MNT_DETACH) < 0 && errno != ENOENT) {
condlog(0, "failed to umount '%s' (%s). skipping", mnt, strerror(errno));
^ permalink raw reply [flat|nested] 17+ messages in thread
* multipath-tools/multipathd main.c
@ 2009-04-27 21:19 bmarzins
0 siblings, 0 replies; 17+ messages in thread
From: bmarzins @ 2009-04-27 21:19 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: bmarzins@sourceware.org 2009-04-27 21:19:41
Modified files:
multipathd : main.c
Log message:
Fix bz #496682. Multipathd not unmounting any device mounted anywhere under
/etc from its private namespace. It only needs /etc itself, so it should allow
any device mounted on a subdirectory to be unmounted. This is not applicable
upstream.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.69.2.19&r2=1.69.2.20
--- multipath-tools/multipathd/main.c 2009/04/21 00:05:23 1.69.2.19
+++ multipath-tools/multipathd/main.c 2009/04/27 21:19:41 1.69.2.20
@@ -1286,9 +1286,11 @@
if (strcmp(mnt, "/") == 0 || strcmp(mnt, "/sbin") == 0 ||
strcmp(mnt, "/bin") == 0 || strcmp(mnt, "/tmp") == 0 ||
strcmp(mnt, "/usr") == 0 || strncmp(mnt, "/usr/lib", 8) == 0 ||
- strncmp(mnt, "/etc", 4) == 0 || strncmp(mnt, "/proc", 5) == 0 ||
+ strcmp(mnt, "/etc") == 0 || strncmp(mnt, "/proc", 5) == 0 ||
strncmp(mnt, "/dev", 4) == 0 || strncmp(mnt, "/sys", 4) == 0 ||
- strncmp(mnt, "/var", 4) == 0 || strncmp(mnt, "/lib", 4) == 0)
+ strncmp(mnt, "/var", 4) == 0 || strncmp(mnt, "/lib", 4) == 0 ||
+ strncmp(mnt, "/lib64", 6) == 0 ||
+ strncmp(mnt, "/usr/lib64", 10) == 0)
continue;
if (umount2(mnt, MNT_DETACH) < 0 && errno != ENOENT) {
condlog(0, "failed to umount '%s' (%s). skipping", mnt, strerror(errno));
^ permalink raw reply [flat|nested] 17+ messages in thread
* multipath-tools/multipathd main.c
@ 2008-10-17 18:37 bmarzins
0 siblings, 0 replies; 17+ messages in thread
From: bmarzins @ 2008-10-17 18:37 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL4_FC5
Changes by: bmarzins@sourceware.org 2008-10-17 18:37:54
Modified files:
multipathd : main.c
Log message:
Don't check the map flags for an orphaned path.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL4_FC5&r1=1.66.2.4&r2=1.66.2.5
--- multipath-tools/multipathd/main.c 2008/04/14 22:40:09 1.66.2.4
+++ multipath-tools/multipathd/main.c 2008/10/17 18:37:53 1.66.2.5
@@ -863,7 +863,7 @@
break;
}
}
- if (!found && mpp->flush_on_last_del == FLUSH_ENABLED) {
+ if (mpp && !found && mpp->flush_on_last_del == FLUSH_ENABLED) {
condlog(1, "%s: Last path deleted, disabling queueing",
mpp->alias);
mpp->retry_tick = 0;
^ permalink raw reply [flat|nested] 17+ messages in thread
* multipath-tools/multipathd main.c
@ 2008-09-12 23:49 bmarzins
0 siblings, 0 replies; 17+ messages in thread
From: bmarzins @ 2008-09-12 23:49 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: bmarzins@sourceware.org 2008-09-12 23:49:57
Modified files:
multipathd : main.c
Log message:
Fix for bz 449097. When multipathd creates a new namespace for the
callout functions, it now unmounts all of the unneeded mounts that it inherits
the calling process.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.69.2.12&r2=1.69.2.13
--- multipath-tools/multipathd/main.c 2008/09/08 22:01:20 1.69.2.12
+++ multipath-tools/multipathd/main.c 2008/09/12 23:49:57 1.69.2.13
@@ -15,6 +15,7 @@
#include <errno.h>
#include <sys/time.h>
#include <sys/resource.h>
+#include <sys/mount.h>
/*
* libsysfs
@@ -62,6 +63,10 @@
#include "waiter.h"
#include "copy.h"
+#if !defined(MNT_DETACH)
+#define MNT_DETACH 2
+#endif
+
#define FILE_NAME_SIZE 256
#define CMDSIZE 160
@@ -1231,6 +1236,47 @@
return NULL;
}
+static int
+unmount_extra_devs(void)
+{
+ int ret;
+ char buf[LINE_MAX];
+ FILE *file;
+
+ file = fopen("/proc/mounts", "r");
+ if (!file) {
+ condlog(0, "couldn't open /proc/mounts : %s", strerror(errno));
+ return -1;
+ }
+
+ while (fgets(buf, LINE_MAX, file)) {
+ char *end, *mnt = strchr(buf, ' ');
+ if (!mnt)
+ continue;
+ mnt++;
+ end = strchr(mnt, ' ');
+ if (!end) {
+ condlog(2, "can't process /proc/mounts line (%s). skipping", buf);
+ continue;
+ }
+ *end = '\0';
+ if (strcmp(mnt, "/") == 0 || strcmp(mnt, "/sbin") == 0 ||
+ strcmp(mnt, "/bin") == 0 || strcmp(mnt, "/tmp") == 0 ||
+ strcmp(mnt, "/usr") == 0 || strncmp(mnt, "/usr/lib", 8) == 0 ||
+ strncmp(mnt, "/etc", 4) == 0 || strncmp(mnt, "/proc", 5) == 0 ||
+ strncmp(mnt, "/dev", 4) == 0 || strncmp(mnt, "/sys", 4) == 0 ||
+ strncmp(mnt, "/var", 4) == 0 || strncmp(mnt, "/lib", 4) == 0)
+ continue;
+ if (umount2(mnt, MNT_DETACH) < 0 && errno != ENOENT) {
+ condlog(0, "failed to umount '%s' (%s). skipping", mnt, strerror(errno));
+ }
+ }
+ fclose(file);
+ return ret;
+}
+
+
+
#ifdef CLONE_NEWNS
static int
@@ -1328,7 +1374,8 @@
return -1;
}
condlog(4, "bind ramfs on /tmp");
-
+ if (unmount_extra_devs() < 0)
+ return -1;
return 0;
}
#endif
^ permalink raw reply [flat|nested] 17+ messages in thread
* multipath-tools/multipathd main.c
@ 2008-09-04 23:31 bmarzins
0 siblings, 0 replies; 17+ messages in thread
From: bmarzins @ 2008-09-04 23:31 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: bmarzins@sourceware.org 2008-09-04 23:31:39
Modified files:
multipathd : main.c
Log message:
Typo in my fix for 238421
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.69.2.10&r2=1.69.2.11
--- multipath-tools/multipathd/main.c 2008/09/04 20:09:48 1.69.2.10
+++ multipath-tools/multipathd/main.c 2008/09/04 23:31:39 1.69.2.11
@@ -516,7 +516,7 @@
condlog(2, "%s Last path deleted, disabling queueing", mpp->alias);
mpp->retry_tick = 0;
mpp->no_path_retry = NO_PATH_RETRY_FAIL;
- mpp->flush_on_last_del == FLUSH_IN_PROGRESS;
+ mpp->flush_on_last_del = FLUSH_IN_PROGRESS;
dm_queue_if_no_path(mpp->alias, 0);
}
if (flush_map(mpp, vecs))
@@ -575,7 +575,7 @@
condlog(2, "%s Last path deleted, disabling queueing", mpp->alias);
mpp->retry_tick = 0;
mpp->no_path_retry = NO_PATH_RETRY_FAIL;
- mpp->flush_on_last_del == FLUSH_IN_PROGRESS;
+ mpp->flush_on_last_del = FLUSH_IN_PROGRESS;
dm_queue_if_no_path(mpp->alias, 0);
}
if (flush_map(mpp, vecs))
^ permalink raw reply [flat|nested] 17+ messages in thread
* multipath-tools/multipathd main.c
@ 2008-05-12 18:48 bmarzins
0 siblings, 0 replies; 17+ messages in thread
From: bmarzins @ 2008-05-12 18:48 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: bmarzins@sourceware.org 2008-05-12 18:48:03
Modified files:
multipathd : main.c
Log message:
Fix multipathd startup so -d option works correctly.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.69.2.6&r2=1.69.2.7
--- multipath-tools/multipathd/main.c 2008/05/12 17:45:28 1.69.2.6
+++ multipath-tools/multipathd/main.c 2008/05/12 18:48:03 1.69.2.7
@@ -1422,15 +1422,31 @@
umask(0);
}
+enum child_flag_bits {
+ __DAEMONIZE = 0,
+#ifdef CLONE_NEWNS
+ __NEW_NS,
+#endif
+};
+
+#define DAEMONIZE (1 << __DAEMONIZE)
+#ifdef CLONE_NEWNS
+#define NEW_NS (1 << __NEW_NS)
+#endif
+
static int
child (void * param)
{
pthread_t check_thr, uevent_thr, uxlsnr_thr;
pthread_attr_t attr;
struct vectors * vecs;
- unsigned long new_ns = (unsigned long)param;
+ unsigned int daemon = (unsigned long)param & DAEMONIZE;
+#ifdef CLONE_NEWNS
+ unsigned int new_ns = (unsigned long)param & NEW_NS;
+#endif
- setup_daemon();
+ if (daemon)
+ setup_daemon();
mlockall(MCL_CURRENT | MCL_FUTURE);
if (logsink)
@@ -1583,11 +1599,11 @@
#ifdef CLONE_NEWNS
if (unshare(CLONE_NEWNS) < 0) {
fprintf(stderr, "Failed to unshare namespace : %s\n", strerror(errno));
- return child((void *)0);
+ return child((void *)DAEMONIZE);
}
- return child((void *)1);
+ return child((void *)(DAEMONIZE | NEW_NS));
#else
- return child((void *)0);
+ return child((void *)DAEMONIZE);
#endif
}
^ permalink raw reply [flat|nested] 17+ messages in thread
* multipath-tools/multipathd main.c
@ 2007-04-26 17:47 bmarzins
0 siblings, 0 replies; 17+ messages in thread
From: bmarzins @ 2007-04-26 17:47 UTC (permalink / raw)
To: dm-cvs, dm-devel
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL4_FC5
Changes by: bmarzins@sourceware.org 2007-04-26 18:47:01
Modified files:
multipathd : main.c
Log message:
pulled upstream patch to fix multipath daemon segfaults.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipathd/main.c.diff?cvsroot=dm&only_with_tag=RHEL4_FC5&r1=1.66.2.1&r2=1.66.2.2
--- multipath-tools/multipathd/main.c 2006/07/11 22:49:22 1.66.2.1
+++ multipath-tools/multipathd/main.c 2007/04/26 17:47:01 1.66.2.2
@@ -1542,6 +1542,7 @@
signal_set(SIGINT, sigend);
signal_set(SIGTERM, sigend);
signal_set(SIGKILL, sigend);
+ signal(SIGPIPE, SIG_IGN);
}
static void
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2012-08-10 18:49 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-22 18:02 multipath-tools/multipathd main.c bmarzins
-- strict thread matches above, loose matches on Subject: below --
2012-08-10 18:49 bmarzins
2012-08-07 19:37 bmarzins
2011-10-24 13:46 bmarzins
2011-10-10 3:47 bmarzins
2011-04-11 17:01 bmarzins
2010-12-07 6:02 bmarzins
2010-09-01 18:29 bmarzins
2010-08-09 16:16 bmarzins
2009-11-02 19:11 bmarzins
2009-09-10 16:27 bmarzins
2009-04-27 21:19 bmarzins
2008-10-17 18:37 bmarzins
2008-09-12 23:49 bmarzins
2008-09-04 23:31 bmarzins
2008-05-12 18:48 bmarzins
2007-04-26 17:47 bmarzins
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).