Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=6f…
Commit: 6f9e71a735281ae034cb9741a499b01127f9712e
Parent: 4c44c6e523a4c8521f55fc7330508c493da379f5
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Fri May 28 08:28:46 2010 -0500
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Fri May 28 08:28:46 2010 -0500
Fix device name and mount point in utils
This patch fixes a regression introduced by commit 04f7da3 whereby
the gfs2-utils identified whether a gfs2 file system was mounted.
The method works fine when specifying the mount point for tools like
gfs2_grow. However, it doesn't work when the device is specified.
The solution is to copy the discovered device name and mount point
into the proper libgfs2 variables used by the utils.
rhbz#597002
---
gfs2/libgfs2/misc.c | 27 +++++++++++++++------------
1 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c
index e277e27..81c7e2e 100644
--- a/gfs2/libgfs2/misc.c
+++ b/gfs2/libgfs2/misc.c
@@ -121,9 +121,7 @@ int is_pathname_mounted(struct gfs2_sbd *sdp, int *ro_mount)
}
if (stat(sdp->path_name, &st_buf) == 0) {
if (S_ISBLK(st_buf.st_mode)) {
-#ifndef __GNU__ /* The GNU hurd is broken with respect to stat devices */
file_rdev = st_buf.st_rdev;
-#endif /* __GNU__ */
} else {
file_dev = st_buf.st_dev;
file_ino = st_buf.st_ino;
@@ -139,16 +137,21 @@ int is_pathname_mounted(struct gfs2_sbd *sdp, int *ro_mount)
strcpy(sdp->device_name, mnt->mnt_fsname); /* fix it */
break;
}
- if (stat(mnt->mnt_fsname, &st_buf) == 0) {
- if (S_ISBLK(st_buf.st_mode)) {
-#ifndef __GNU__
- if (file_rdev && (file_rdev == st_buf.st_rdev))
- break;
-#endif /* __GNU__ */
- } else {
- if (file_dev && ((file_dev == st_buf.st_dev) &&
- (file_ino == st_buf.st_ino)))
- break;
+ if (stat(mnt->mnt_fsname, &st_buf) != 0)
+ continue;
+
+ if (S_ISBLK(st_buf.st_mode)) {
+ if (file_rdev && (file_rdev == st_buf.st_rdev)) {
+ strcpy(sdp->device_name, mnt->mnt_fsname);
+ strcpy(sdp->path_name, mnt->mnt_dir);
+ break;
+ }
+ } else {
+ if (file_dev && ((file_dev == st_buf.st_dev) &&
+ (file_ino == st_buf.st_ino))) {
+ strcpy(sdp->device_name, mnt->mnt_fsname);
+ strcpy(sdp->path_name, mnt->mnt_dir);
+ break;
}
}
}
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=de…
Commit: de94f7c47a2dcea549427bfbfadda5a8bb2e5a10
Parent: f7a3fe0e4375d08f545ef6b3f7617295b56373c6
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Fri May 28 08:28:46 2010 -0500
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Fri May 28 09:38:50 2010 -0500
Fix device name and mount point in utils
This patch fixes a regression introduced by commit 04f7da3 whereby
the gfs2-utils identified whether a gfs2 file system was mounted.
The method works fine when specifying the mount point for tools like
gfs2_grow. However, it doesn't work when the device is specified.
The solution is to copy the discovered device name and mount point
into the proper libgfs2 variables used by the utils.
rhbz#597002
---
gfs2/libgfs2/misc.c | 27 +++++++++++++++------------
1 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c
index 8981114..31fc665 100644
--- a/gfs2/libgfs2/misc.c
+++ b/gfs2/libgfs2/misc.c
@@ -113,9 +113,7 @@ int is_pathname_mounted(struct gfs2_sbd *sdp, int *ro_mount)
}
if (stat(sdp->path_name, &st_buf) == 0) {
if (S_ISBLK(st_buf.st_mode)) {
-#ifndef __GNU__ /* The GNU hurd is broken with respect to stat devices */
file_rdev = st_buf.st_rdev;
-#endif /* __GNU__ */
} else {
file_dev = st_buf.st_dev;
file_ino = st_buf.st_ino;
@@ -131,16 +129,21 @@ int is_pathname_mounted(struct gfs2_sbd *sdp, int *ro_mount)
strcpy(sdp->device_name, mnt->mnt_fsname); /* fix it */
break;
}
- if (stat(mnt->mnt_fsname, &st_buf) == 0) {
- if (S_ISBLK(st_buf.st_mode)) {
-#ifndef __GNU__
- if (file_rdev && (file_rdev == st_buf.st_rdev))
- break;
-#endif /* __GNU__ */
- } else {
- if (file_dev && ((file_dev == st_buf.st_dev) &&
- (file_ino == st_buf.st_ino)))
- break;
+ if (stat(mnt->mnt_fsname, &st_buf) != 0)
+ continue;
+
+ if (S_ISBLK(st_buf.st_mode)) {
+ if (file_rdev && (file_rdev == st_buf.st_rdev)) {
+ strcpy(sdp->device_name, mnt->mnt_fsname);
+ strcpy(sdp->path_name, mnt->mnt_dir);
+ break;
+ }
+ } else {
+ if (file_dev && ((file_dev == st_buf.st_dev) &&
+ (file_ino == st_buf.st_ino))) {
+ strcpy(sdp->device_name, mnt->mnt_fsname);
+ strcpy(sdp->path_name, mnt->mnt_dir);
+ break;
}
}
}
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=e7…
Commit: e724bb5fe6abc7395c525b2bf483810577b92c33
Parent: cc64807655a955c7eaa460d6e3707c051a773305
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Fri May 28 08:28:46 2010 -0500
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Fri May 28 08:39:01 2010 -0500
Fix device name and mount point in utils
This patch fixes a regression introduced by commit 04f7da3 whereby
the gfs2-utils identified whether a gfs2 file system was mounted.
The method works fine when specifying the mount point for tools like
gfs2_grow. However, it doesn't work when the device is specified.
The solution is to copy the discovered device name and mount point
into the proper libgfs2 variables used by the utils.
rhbz#597002
---
gfs2/libgfs2/misc.c | 27 +++++++++++++++------------
1 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c
index 8981114..31fc665 100644
--- a/gfs2/libgfs2/misc.c
+++ b/gfs2/libgfs2/misc.c
@@ -113,9 +113,7 @@ int is_pathname_mounted(struct gfs2_sbd *sdp, int *ro_mount)
}
if (stat(sdp->path_name, &st_buf) == 0) {
if (S_ISBLK(st_buf.st_mode)) {
-#ifndef __GNU__ /* The GNU hurd is broken with respect to stat devices */
file_rdev = st_buf.st_rdev;
-#endif /* __GNU__ */
} else {
file_dev = st_buf.st_dev;
file_ino = st_buf.st_ino;
@@ -131,16 +129,21 @@ int is_pathname_mounted(struct gfs2_sbd *sdp, int *ro_mount)
strcpy(sdp->device_name, mnt->mnt_fsname); /* fix it */
break;
}
- if (stat(mnt->mnt_fsname, &st_buf) == 0) {
- if (S_ISBLK(st_buf.st_mode)) {
-#ifndef __GNU__
- if (file_rdev && (file_rdev == st_buf.st_rdev))
- break;
-#endif /* __GNU__ */
- } else {
- if (file_dev && ((file_dev == st_buf.st_dev) &&
- (file_ino == st_buf.st_ino)))
- break;
+ if (stat(mnt->mnt_fsname, &st_buf) != 0)
+ continue;
+
+ if (S_ISBLK(st_buf.st_mode)) {
+ if (file_rdev && (file_rdev == st_buf.st_rdev)) {
+ strcpy(sdp->device_name, mnt->mnt_fsname);
+ strcpy(sdp->path_name, mnt->mnt_dir);
+ break;
+ }
+ } else {
+ if (file_dev && ((file_dev == st_buf.st_dev) &&
+ (file_ino == st_buf.st_ino))) {
+ strcpy(sdp->device_name, mnt->mnt_fsname);
+ strcpy(sdp->path_name, mnt->mnt_dir);
+ break;
}
}
}
Gitweb: http://git.fedorahosted.org/git/dlm.git?p=dlm.git;a=commitdiff;h=10e53d7fae…
Commit: 10e53d7fae4cd576518864fb4309e88402cecc56
Parent: 1ff741d523bda31af31971ba8a898aa391c004ef
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu May 27 10:29:19 2010 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu May 27 10:33:02 2010 -0500
dlm_controld: wrong fencing time comparison (2)
Slight change to commit 4039bf4817a96b6aab20de948389f43b89ce4a8e
to account for the fact that sometimes fenced time can be within
a second of fail time.
bz 594511
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
group/dlm_controld/cpg.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/group/dlm_controld/cpg.c b/group/dlm_controld/cpg.c
index 94a9b68..93cf108 100644
--- a/group/dlm_controld/cpg.c
+++ b/group/dlm_controld/cpg.c
@@ -542,7 +542,11 @@ static int check_fencing_done(struct lockspace *ls)
if (rv < 0)
log_error("fenced_node_info error %d", rv);
- if (last_fenced_time > node->fail_time) {
+ /* need >= not just > because in at least one case
+ we've seen fenced_time within the same second as
+ fail_time: with external fencing, e.g. fence_node */
+
+ if (last_fenced_time >= node->fail_time) {
log_group(ls, "check_fencing %d done "
"add %llu fail %llu last %llu",
node->nodeid,
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=cc…
Commit: cc64807655a955c7eaa460d6e3707c051a773305
Parent: cd5b1d943b588f8bd36dae78e87db29e9c9feb7b
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu May 27 10:29:19 2010 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu May 27 10:32:23 2010 -0500
dlm_controld: wrong fencing time comparison (2)
Slight change to commit 4039bf4817a96b6aab20de948389f43b89ce4a8e
to account for the fact that sometimes fenced time can be within
a second of fail time.
bz 594511
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
group/dlm_controld/cpg.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/group/dlm_controld/cpg.c b/group/dlm_controld/cpg.c
index 94a9b68..93cf108 100644
--- a/group/dlm_controld/cpg.c
+++ b/group/dlm_controld/cpg.c
@@ -542,7 +542,11 @@ static int check_fencing_done(struct lockspace *ls)
if (rv < 0)
log_error("fenced_node_info error %d", rv);
- if (last_fenced_time > node->fail_time) {
+ /* need >= not just > because in at least one case
+ we've seen fenced_time within the same second as
+ fail_time: with external fencing, e.g. fence_node */
+
+ if (last_fenced_time >= node->fail_time) {
log_group(ls, "check_fencing %d done "
"add %llu fail %llu last %llu",
node->nodeid,
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=f7…
Commit: f7a3fe0e4375d08f545ef6b3f7617295b56373c6
Parent: bafd8b8cc294c2c1dae9d375f40ec64217fca81d
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu May 27 10:29:19 2010 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu May 27 10:29:19 2010 -0500
dlm_controld: wrong fencing time comparison (2)
Slight change to commit 4039bf4817a96b6aab20de948389f43b89ce4a8e
to account for the fact that sometimes fenced time can be within
a second of fail time.
bz 594511
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
group/dlm_controld/cpg.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/group/dlm_controld/cpg.c b/group/dlm_controld/cpg.c
index 94a9b68..93cf108 100644
--- a/group/dlm_controld/cpg.c
+++ b/group/dlm_controld/cpg.c
@@ -542,7 +542,11 @@ static int check_fencing_done(struct lockspace *ls)
if (rv < 0)
log_error("fenced_node_info error %d", rv);
- if (last_fenced_time > node->fail_time) {
+ /* need >= not just > because in at least one case
+ we've seen fenced_time within the same second as
+ fail_time: with external fencing, e.g. fence_node */
+
+ if (last_fenced_time >= node->fail_time) {
log_group(ls, "check_fencing %d done "
"add %llu fail %llu last %llu",
node->nodeid,
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=f2…
Commit: f288015025489cb35230c61f82d02c3d70e4a40e
Parent: b4317363d5db48458a015ac4d4de63a5048a9509
Author: Christine Caulfield <ccaulfie(a)redhat.com>
AuthorDate: Wed May 26 09:51:34 2010 +0100
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Wed May 26 15:34:45 2010 +0100
cman: fix quorum recalculation when a node is externally killed
This patch fixes a condition where quorum would be incorrectly recalculated
if a node was removed from the cluster using the cman_kill_node call.
This call is used by qdisk and can cause a cluster to continue operating
when too few nodes are left in the cluster for a legitimate quorum.
rhbz#596046
Signed-off-by: Christine Caulfield <ccaulfie(a)redhat.com>
---
cman/daemon/commands.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c
index d50a6e0..2fe4ec9 100644
--- a/cman/daemon/commands.c
+++ b/cman/daemon/commands.c
@@ -971,7 +971,7 @@ static int do_cmd_leave_cluster(char *cmdbuf, int *retlen)
memcpy(&leave_flags, cmdbuf, sizeof(int));
/* Ignore the use count if FORCE is set */
- if (!(leave_flags & CLUSTER_LEAVEFLAG_FORCE)) {
+ if (!(leave_flags == CLUSTER_LEAVEFLAG_FORCE)) {
if (use_count)
return -ENOTCONN;
}
@@ -1007,7 +1007,7 @@ static void check_shutdown_status(void)
shutdown_flags & SHUTDOWN_ANYWAY) {
quit_threads = 1;
if (shutdown_flags & SHUTDOWN_REMOVE)
- leaveflags |= CLUSTER_LEAVEFLAG_REMOVED;
+ leaveflags = CLUSTER_LEAVEFLAG_REMOVED;
send_leave(leaveflags);
reply = 0;
}
@@ -2266,7 +2266,7 @@ void del_ais_node(int nodeid)
cluster_members--;
log_printf(LOGSYS_LEVEL_DEBUG, "memb: del_ais_node %s, leave_reason=%x\n", node->name, node->leave_reason);
- if ((node->leave_reason & 0xF) == CLUSTER_LEAVEFLAG_REMOVED)
+ if (node->leave_reason == CLUSTER_LEAVEFLAG_REMOVED)
recalculate_quorum(1, 1);
else
recalculate_quorum(0, 0);
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=28…
Commit: 28ab9a75f70b4d5bd5126d546a3a5a68f1f6bde2
Parent: b165ce47df6f03c340abf4baa48b74368d12bf54
Author: Christine Caulfield <ccaulfie(a)redhat.com>
AuthorDate: Wed May 26 09:51:34 2010 +0100
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Wed May 26 09:51:34 2010 +0100
cman: fix quorum recalculation when a node is externally killed
This patch fixes a condition where quorum would be incorrectly recalculated
if a node was removed from the cluster using the cman_kill_node call.
This call is used by qdisk and can cause a cluster to continue operating
when too few nodes are left in the cluster for a legitimate quorum.
Signed-off-by: Christine Caulfield <ccaulfie(a)redhat.com>
---
cman/daemon/commands.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c
index d50a6e0..2fe4ec9 100644
--- a/cman/daemon/commands.c
+++ b/cman/daemon/commands.c
@@ -971,7 +971,7 @@ static int do_cmd_leave_cluster(char *cmdbuf, int *retlen)
memcpy(&leave_flags, cmdbuf, sizeof(int));
/* Ignore the use count if FORCE is set */
- if (!(leave_flags & CLUSTER_LEAVEFLAG_FORCE)) {
+ if (!(leave_flags == CLUSTER_LEAVEFLAG_FORCE)) {
if (use_count)
return -ENOTCONN;
}
@@ -1007,7 +1007,7 @@ static void check_shutdown_status(void)
shutdown_flags & SHUTDOWN_ANYWAY) {
quit_threads = 1;
if (shutdown_flags & SHUTDOWN_REMOVE)
- leaveflags |= CLUSTER_LEAVEFLAG_REMOVED;
+ leaveflags = CLUSTER_LEAVEFLAG_REMOVED;
send_leave(leaveflags);
reply = 0;
}
@@ -2266,7 +2266,7 @@ void del_ais_node(int nodeid)
cluster_members--;
log_printf(LOGSYS_LEVEL_DEBUG, "memb: del_ais_node %s, leave_reason=%x\n", node->name, node->leave_reason);
- if ((node->leave_reason & 0xF) == CLUSTER_LEAVEFLAG_REMOVED)
+ if (node->leave_reason == CLUSTER_LEAVEFLAG_REMOVED)
recalculate_quorum(1, 1);
else
recalculate_quorum(0, 0);