gfs2-utils: master - gfs2_edit: has problems printing gfs1 journals
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitd...
Commit: c81702e92ff710c3c12ccca13e8c30eff269427f
Parent: dde989e50401270fbfd8882c10e44e401afd78ec
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Thu Feb 3 08:13:35 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Feb 3 08:13:35 2011 -0600
gfs2_edit: has problems printing gfs1 journals
The gfs2_edit tool was releasing the buffer too soon while printing out
journals. It worked for gfs2 journals, but not for gfs1 journals. This
patch moves the buffer release later in the function so that gfs1 journals
will print correctly.
rhbz#656371
---
gfs2/edit/hexedit.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 13d432f..aa49d50 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -2025,7 +2025,6 @@ static uint64_t find_journal_block(const char *journal, uint64_t *j_size)
if (!gfs1)
do_dinode_extended(&di, jindex_bh); /* parse dir. */
- brelse(jindex_bh);
if (gfs1) {
struct gfs2_inode *jiinode;
@@ -2050,6 +2049,7 @@ static uint64_t find_journal_block(const char *journal, uint64_t *j_size)
*j_size = jdi.di_size;
brelse(j_bh);
}
+ brelse(jindex_bh);
return jblock;
}
13 years, 4 months
gfs2-utils: master - gfs2_edit: print large block numbers better
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitd...
Commit: dde989e50401270fbfd8882c10e44e401afd78ec
Parent: 5c35d4c605b171c8e431990ac137816ac65f2b0f
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Wed Feb 2 15:57:18 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Wed Feb 2 15:57:18 2011 -0600
gfs2_edit: print large block numbers better
The gfs2_edit tool was obscuring block number on the display when
the block number got big enough. This patch makes it print the
block number so that it looks better when it gets big.
rhbz#656371
---
gfs2/edit/hexedit.c | 13 +++----------
1 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index cdcdecd..13d432f 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -1061,17 +1061,10 @@ int display_block_type(int from_restore)
if (termlines) {
if (edit_row[dmode] == -1)
COLORS_NORMAL;
- move(line,30);
- }
- else
- print_gfs2(" ");
- if (!from_restore) {
- print_gfs2("of %llu (0x%llx)", max_block, max_block);
- if (termlines)
- move(line, 55);
- else
- printf(" ");
}
+ print_gfs2(" ");
+ if (!from_restore)
+ print_gfs2("of %llu (0x%llx) ", max_block, max_block);
if (block == RGLIST_DUMMY_BLOCK) {
ret_type = GFS2_METATYPE_RG;
struct_len = gfs1 ? sizeof(struct gfs_rgrp) : sizeof(struct gfs2_rgrp);
13 years, 4 months
gfs2-utils: master - gfs2_edit: handle corrupt file systems better
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitd...
Commit: 5c35d4c605b171c8e431990ac137816ac65f2b0f
Parent: d8c8af9612e2e00b8d8739a3d72ca9669a593878
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Wed Feb 2 15:49:22 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Wed Feb 2 15:49:22 2011 -0600
gfs2_edit: handle corrupt file systems better
This patch adds some checks to gfs2_edit so that it will not segfault
when it encounters certain types of file system corruption. This makes
it a more useful tool for examining corrupt metadata sets.
rhbz#656371
---
gfs2/edit/hexedit.c | 10 ++++++----
gfs2/libgfs2/fs_bits.c | 2 ++
gfs2/libgfs2/rgrp.c | 5 +++--
3 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 2472bbf..cdcdecd 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -1793,11 +1793,13 @@ static void read_superblock(int fd)
sbd.bsize = sbd.sd_sb.sb_bsize;
if (!sbd.bsize)
sbd.bsize = GFS2_DEFAULT_BSIZE;
- if (compute_constants(&sbd)) {
- fprintf(stderr, "Bad constants (1)\n");
- exit(-1);
+ compute_constants(&sbd);
+ if (gfs1 || (sbd.sd_sb.sb_header.mh_magic == GFS2_MAGIC &&
+ sbd.sd_sb.sb_header.mh_type == GFS2_METATYPE_SB))
+ block = 0x10 * (GFS2_DEFAULT_BSIZE / sbd.bsize);
+ else {
+ block = starting_blk = 0;
}
- block = 0x10 * (GFS2_DEFAULT_BSIZE / sbd.bsize);
device_geometry(&sbd);
if (fix_device_geometry(&sbd)) {
fprintf(stderr, "Device is too small (%llu bytes)\n",
diff --git a/gfs2/libgfs2/fs_bits.c b/gfs2/libgfs2/fs_bits.c
index 6f096f3..7d37d57 100644
--- a/gfs2/libgfs2/fs_bits.c
+++ b/gfs2/libgfs2/fs_bits.c
@@ -232,6 +232,8 @@ int gfs2_get_bitmap(struct gfs2_sbd *sdp, uint64_t blkno,
if (i >= rgd->ri.ri_length)
return -1;
+ if (!rgd->bh || !rgd->bh[i])
+ return 0;
byte = (unsigned char *)(rgd->bh[i]->b_data + bits->bi_offset) +
(rgrp_block/GFS2_NBBY - bits->bi_start);
bit = (rgrp_block % GFS2_NBBY) * GFS2_BIT_SIZE;
diff --git a/gfs2/libgfs2/rgrp.c b/gfs2/libgfs2/rgrp.c
index 2a6fa3f..2ec55b5 100644
--- a/gfs2/libgfs2/rgrp.c
+++ b/gfs2/libgfs2/rgrp.c
@@ -169,8 +169,9 @@ void gfs2_rgrp_relse(struct rgrp_list *rgd)
int x, length = rgd->ri.ri_length;
for (x = 0; x < length; x++) {
- if (rgd->bh && rgd->bh[x]) {
- brelse(rgd->bh[x]);
+ if (rgd->bh) {
+ if (rgd->bh[x])
+ brelse(rgd->bh[x]);
rgd->bh[x] = NULL;
}
}
13 years, 4 months
resource-agents: master - fs-lib: fix do_monitor device mapping
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/resource-agents.git?p=resource-agents.git...
Commit: a23793faa3c7718177cbbda77363d5fd3765415d
Parent: f9960d41fb8adced22c83e6db73d950b31f7cde1
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Thu Feb 3 17:33:25 2011 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Thu Feb 3 17:33:25 2011 +0100
fs-lib: fix do_monitor device mapping
do_monitor needs to expand _device key to the real device
before performing checks
Resolves: rhbz#669832
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
rgmanager/src/resources/utils/fs-lib.sh | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/rgmanager/src/resources/utils/fs-lib.sh b/rgmanager/src/resources/utils/fs-lib.sh
index 4f242f7..7b933f8 100644
--- a/rgmanager/src/resources/utils/fs-lib.sh
+++ b/rgmanager/src/resources/utils/fs-lib.sh
@@ -866,7 +866,18 @@ do_stop() {
do_monitor() {
- is_mounted "${OCF_RESKEY_device}" "${OCF_RESKEY_mountpoint}"
+ #
+ # Get the device
+ #
+ real_device "$OCF_RESKEY_device"
+ dev="$REAL_DEVICE"
+ if [ -z "$dev" ]; then
+ ocf_log err "\
+start_filesystem: Could not match $OCF_RESKEY_device with a real device"
+ return $OCF_ERR_ARGS
+ fi
+
+ is_mounted "$dev" "${OCF_RESKEY_mountpoint}"
if [ $? -ne $YES ]; then
ocf_log err "${OCF_RESOURCE_INSTANCE}: ${OCF_RESKEY_device} is not mounted on ${OCF_RESKEY_mountpoint}"
13 years, 4 months
cluster: RHEL6 - rgmanager: Support convalesce w/ central_processing
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: fe9dc9c97b5cc3173582f815cbfa4e619333fce9
Parent: 27822b33fa334cefe8ba1783eb74c046de849865
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Thu Sep 9 10:58:17 2010 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Thu Feb 3 11:23:02 2011 -0500
rgmanager: Support convalesce w/ central_processing
This is just a split of commit
3b03b46fe7d3c7d747db9a2b7721cc56aef458f2
in to two parts for the respective packages.
Resolves: rhbz#634277
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/include/event.h | 1 +
rgmanager/src/daemons/service_op.c | 84 +++++++++++++++++++++++++++++++++++
rgmanager/src/daemons/slang_event.c | 18 +++++++-
3 files changed, 102 insertions(+), 1 deletions(-)
diff --git a/rgmanager/include/event.h b/rgmanager/include/event.h
index a9a8235..ad3fe39 100644
--- a/rgmanager/include/event.h
+++ b/rgmanager/include/event.h
@@ -124,6 +124,7 @@ void set_transition_throttling(int nsecs);
int service_op_start(char *svcName, int *target_list, int target_list_len,
int *new_owner);
int service_op_stop(char *svcName, int do_disable, int event_type);
+int service_op_convalesce(const char *svcName);
int service_op_migrate(char *svcName, int target_node);
diff --git a/rgmanager/src/daemons/service_op.c b/rgmanager/src/daemons/service_op.c
index 112b267..f094129 100644
--- a/rgmanager/src/daemons/service_op.c
+++ b/rgmanager/src/daemons/service_op.c
@@ -186,6 +186,90 @@ service_op_stop(char *svcName, int do_disable, int event_type)
}
+int
+service_op_convalesce(const char *svcName)
+{
+ SmMessageSt msg;
+ int msg_ret;
+ msgctx_t ctx;
+ rg_state_t svcStatus;
+ int msgtarget = my_id();
+
+ /* Build the message header */
+ msg.sm_hdr.gh_magic = GENERIC_HDR_MAGIC;
+ msg.sm_hdr.gh_command = RG_ACTION_REQUEST;
+ msg.sm_hdr.gh_arg1 = RG_ACTION_MASTER;
+ msg.sm_hdr.gh_length = sizeof (SmMessageSt);
+
+ msg.sm_data.d_action = RG_CONVALESCE;
+
+ strncpy(msg.sm_data.d_svcName, svcName,
+ sizeof(msg.sm_data.d_svcName));
+ msg.sm_data.d_ret = 0;
+ msg.sm_data.d_svcOwner = 0;
+
+ /* Open a connection to the local node - it will decide what to
+ do in this case. XXX inefficient; should queue requests
+ locally and immediately forward requests otherwise */
+
+ if (get_service_state_internal(svcName, &svcStatus) < 0)
+ return RG_EFAIL;
+ if (svcStatus.rs_owner > 0) {
+ if (member_online(svcStatus.rs_owner)) {
+ msgtarget = svcStatus.rs_owner;
+ } else {
+ /* If the owner is not online,
+ mark the service as 'stopped' but
+ otherwise, do nothing.
+ */
+ return svc_stop(svcName, RG_STOP);
+ }
+ }
+
+ if (msg_open(MSG_CLUSTER, msgtarget, RG_PORT, &ctx, 2 * cluster_timeout)< 0) {
+ logt_print(LOG_ERR,
+ "#58: Failed opening connection to member #%d\n",
+ my_id());
+ return -1;
+ }
+
+ /* Encode */
+ swab_SmMessageSt(&msg);
+
+ /* Send stop message to the other node */
+ if (msg_send(&ctx, &msg, sizeof (SmMessageSt)) <
+ (int)sizeof (SmMessageSt)) {
+ logt_print(LOG_ERR, "Failed to send complete message\n");
+ msg_close(&ctx);
+ return -1;
+ }
+
+ /* Check the response */
+ do {
+ msg_ret = msg_receive(&ctx, &msg,
+ sizeof (SmMessageSt), 10);
+ if ((msg_ret == -1 && errno != ETIMEDOUT) ||
+ (msg_ret > 0)) {
+ break;
+ }
+ } while(1);
+
+ if (msg_ret != sizeof (SmMessageSt)) {
+ logt_print(LOG_WARNING, "Strange response size: %d vs %d\n",
+ msg_ret, (int)sizeof(SmMessageSt));
+ return 0; /* XXX really UNKNOWN */
+ }
+
+ /* Got a valid response from other node. */
+ msg_close(&ctx);
+
+ /* Decode */
+ swab_SmMessageSt(&msg);
+
+ return msg.sm_data.d_ret;
+}
+
+
/*
service_op_migrate() - send a virtual machine to another host
in the cluster
diff --git a/rgmanager/src/daemons/slang_event.c b/rgmanager/src/daemons/slang_event.c
index 55f0341..0b9f0d0 100644
--- a/rgmanager/src/daemons/slang_event.c
+++ b/rgmanager/src/daemons/slang_event.c
@@ -86,7 +86,8 @@ static int
_user_restart = RG_RESTART,
_user_migrate = RG_MIGRATE,
_user_freeze = RG_FREEZE,
- _user_unfreeze = RG_UNFREEZE;
+ _user_unfreeze = RG_UNFREEZE,
+ _user_convalesce = RG_CONVALESCE;
SLang_Intrin_Var_Type rgmanager_vars[] =
@@ -139,6 +140,7 @@ SLang_Intrin_Var_Type rgmanager_vars[] =
MAKE_VARIABLE((char *)"USER_MIGRATE", &_user_migrate, SLANG_INT_TYPE, 1),
MAKE_VARIABLE((char *)"USER_FREEZE", &_user_freeze, SLANG_INT_TYPE, 1),
MAKE_VARIABLE((char *)"USER_UNFREEZE", &_user_unfreeze,SLANG_INT_TYPE, 1),
+ MAKE_VARIABLE((char *)"USER_CONVALESCE",&_user_convalesce,SLANG_INT_TYPE, 1),
/* Errors */
MAKE_VARIABLE((char *)"rg_error", &_rg_err, SLANG_INT_TYPE, 1),
@@ -444,6 +446,18 @@ sl_service_property(char *svcName, char *prop)
/**
usage:
+ service_convalesce(name);
+ */
+static int
+sl_convalesce_service(const char *svcname)
+{
+ return service_op_convalesce(svcname);
+}
+
+
+/**
+ usage:
+
stop_service(name, disable_flag);
*/
static int
@@ -1034,6 +1048,8 @@ static SLang_Intrin_Fun_Type rgmanager_slang[] =
SLANG_VOID_TYPE),
MAKE_INTRINSIC_0((char *)"service_stop", sl_stop_service,
SLANG_INT_TYPE),
+ MAKE_INTRINSIC_S((char *)"service_convalesce", sl_convalesce_service,
+ SLANG_INT_TYPE),
MAKE_INTRINSIC_0((char *)"service_start", sl_start_service,
SLANG_INT_TYPE),
MAKE_INTRINSIC_0((char *)"service_migrate", sl_migrate_service,
13 years, 4 months
cluster: RHEL6 - resource-agents: Support convalesce w/ central_processing
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 27822b33fa334cefe8ba1783eb74c046de849865
Parent: 216c64116be3b5edad1ea7fcdcde298c67074b44
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Thu Sep 9 10:58:17 2010 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Thu Feb 3 11:23:02 2011 -0500
resource-agents: Support convalesce w/ central_processing
This is just a split of commit
3b03b46fe7d3c7d747db9a2b7721cc56aef458f2
in to two parts for the respective packages.
Resolves: rhbz#674710
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/default_event_script.sl | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/rgmanager/src/resources/default_event_script.sl b/rgmanager/src/resources/default_event_script.sl
index fad22ac..4eae767 100644
--- a/rgmanager/src/resources/default_event_script.sl
+++ b/rgmanager/src/resources/default_event_script.sl
@@ -597,6 +597,10 @@ define default_user_event_handler()
ret = service_migrate(service_name, user_target);
+ } else if (user_request == USER_CONVALESCE) {
+
+ ret = service_convalesce(service_name);
+
}
return ret;
13 years, 4 months
cluster: RHEL6 - Revert "rgmanager: Support convalesce w/ central_processing"
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 216c64116be3b5edad1ea7fcdcde298c67074b44
Parent: b3e375c0554149173390b542de1ef3674da3d128
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Wed Feb 2 20:17:45 2011 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Thu Feb 3 11:23:02 2011 -0500
Revert "rgmanager: Support convalesce w/ central_processing"
This reverts commit 3b03b46fe7d3c7d747db9a2b7721cc56aef458f2.
---
rgmanager/include/event.h | 1 -
rgmanager/src/daemons/service_op.c | 84 -----------------------
rgmanager/src/daemons/slang_event.c | 18 +-----
rgmanager/src/resources/default_event_script.sl | 4 -
4 files changed, 1 insertions(+), 106 deletions(-)
diff --git a/rgmanager/include/event.h b/rgmanager/include/event.h
index ad3fe39..a9a8235 100644
--- a/rgmanager/include/event.h
+++ b/rgmanager/include/event.h
@@ -124,7 +124,6 @@ void set_transition_throttling(int nsecs);
int service_op_start(char *svcName, int *target_list, int target_list_len,
int *new_owner);
int service_op_stop(char *svcName, int do_disable, int event_type);
-int service_op_convalesce(const char *svcName);
int service_op_migrate(char *svcName, int target_node);
diff --git a/rgmanager/src/daemons/service_op.c b/rgmanager/src/daemons/service_op.c
index f094129..112b267 100644
--- a/rgmanager/src/daemons/service_op.c
+++ b/rgmanager/src/daemons/service_op.c
@@ -186,90 +186,6 @@ service_op_stop(char *svcName, int do_disable, int event_type)
}
-int
-service_op_convalesce(const char *svcName)
-{
- SmMessageSt msg;
- int msg_ret;
- msgctx_t ctx;
- rg_state_t svcStatus;
- int msgtarget = my_id();
-
- /* Build the message header */
- msg.sm_hdr.gh_magic = GENERIC_HDR_MAGIC;
- msg.sm_hdr.gh_command = RG_ACTION_REQUEST;
- msg.sm_hdr.gh_arg1 = RG_ACTION_MASTER;
- msg.sm_hdr.gh_length = sizeof (SmMessageSt);
-
- msg.sm_data.d_action = RG_CONVALESCE;
-
- strncpy(msg.sm_data.d_svcName, svcName,
- sizeof(msg.sm_data.d_svcName));
- msg.sm_data.d_ret = 0;
- msg.sm_data.d_svcOwner = 0;
-
- /* Open a connection to the local node - it will decide what to
- do in this case. XXX inefficient; should queue requests
- locally and immediately forward requests otherwise */
-
- if (get_service_state_internal(svcName, &svcStatus) < 0)
- return RG_EFAIL;
- if (svcStatus.rs_owner > 0) {
- if (member_online(svcStatus.rs_owner)) {
- msgtarget = svcStatus.rs_owner;
- } else {
- /* If the owner is not online,
- mark the service as 'stopped' but
- otherwise, do nothing.
- */
- return svc_stop(svcName, RG_STOP);
- }
- }
-
- if (msg_open(MSG_CLUSTER, msgtarget, RG_PORT, &ctx, 2 * cluster_timeout)< 0) {
- logt_print(LOG_ERR,
- "#58: Failed opening connection to member #%d\n",
- my_id());
- return -1;
- }
-
- /* Encode */
- swab_SmMessageSt(&msg);
-
- /* Send stop message to the other node */
- if (msg_send(&ctx, &msg, sizeof (SmMessageSt)) <
- (int)sizeof (SmMessageSt)) {
- logt_print(LOG_ERR, "Failed to send complete message\n");
- msg_close(&ctx);
- return -1;
- }
-
- /* Check the response */
- do {
- msg_ret = msg_receive(&ctx, &msg,
- sizeof (SmMessageSt), 10);
- if ((msg_ret == -1 && errno != ETIMEDOUT) ||
- (msg_ret > 0)) {
- break;
- }
- } while(1);
-
- if (msg_ret != sizeof (SmMessageSt)) {
- logt_print(LOG_WARNING, "Strange response size: %d vs %d\n",
- msg_ret, (int)sizeof(SmMessageSt));
- return 0; /* XXX really UNKNOWN */
- }
-
- /* Got a valid response from other node. */
- msg_close(&ctx);
-
- /* Decode */
- swab_SmMessageSt(&msg);
-
- return msg.sm_data.d_ret;
-}
-
-
/*
service_op_migrate() - send a virtual machine to another host
in the cluster
diff --git a/rgmanager/src/daemons/slang_event.c b/rgmanager/src/daemons/slang_event.c
index 0b9f0d0..55f0341 100644
--- a/rgmanager/src/daemons/slang_event.c
+++ b/rgmanager/src/daemons/slang_event.c
@@ -86,8 +86,7 @@ static int
_user_restart = RG_RESTART,
_user_migrate = RG_MIGRATE,
_user_freeze = RG_FREEZE,
- _user_unfreeze = RG_UNFREEZE,
- _user_convalesce = RG_CONVALESCE;
+ _user_unfreeze = RG_UNFREEZE;
SLang_Intrin_Var_Type rgmanager_vars[] =
@@ -140,7 +139,6 @@ SLang_Intrin_Var_Type rgmanager_vars[] =
MAKE_VARIABLE((char *)"USER_MIGRATE", &_user_migrate, SLANG_INT_TYPE, 1),
MAKE_VARIABLE((char *)"USER_FREEZE", &_user_freeze, SLANG_INT_TYPE, 1),
MAKE_VARIABLE((char *)"USER_UNFREEZE", &_user_unfreeze,SLANG_INT_TYPE, 1),
- MAKE_VARIABLE((char *)"USER_CONVALESCE",&_user_convalesce,SLANG_INT_TYPE, 1),
/* Errors */
MAKE_VARIABLE((char *)"rg_error", &_rg_err, SLANG_INT_TYPE, 1),
@@ -446,18 +444,6 @@ sl_service_property(char *svcName, char *prop)
/**
usage:
- service_convalesce(name);
- */
-static int
-sl_convalesce_service(const char *svcname)
-{
- return service_op_convalesce(svcname);
-}
-
-
-/**
- usage:
-
stop_service(name, disable_flag);
*/
static int
@@ -1048,8 +1034,6 @@ static SLang_Intrin_Fun_Type rgmanager_slang[] =
SLANG_VOID_TYPE),
MAKE_INTRINSIC_0((char *)"service_stop", sl_stop_service,
SLANG_INT_TYPE),
- MAKE_INTRINSIC_S((char *)"service_convalesce", sl_convalesce_service,
- SLANG_INT_TYPE),
MAKE_INTRINSIC_0((char *)"service_start", sl_start_service,
SLANG_INT_TYPE),
MAKE_INTRINSIC_0((char *)"service_migrate", sl_migrate_service,
diff --git a/rgmanager/src/resources/default_event_script.sl b/rgmanager/src/resources/default_event_script.sl
index 4eae767..fad22ac 100644
--- a/rgmanager/src/resources/default_event_script.sl
+++ b/rgmanager/src/resources/default_event_script.sl
@@ -597,10 +597,6 @@ define default_user_event_handler()
ret = service_migrate(service_name, user_target);
- } else if (user_request == USER_CONVALESCE) {
-
- ret = service_convalesce(service_name);
-
}
return ret;
13 years, 4 months
cluster: RHEL57 - gfs2_edit: Fix bitmap editing function
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: dbbb859091a700db2fc4dcd4e4df4a0dfdaa84b1
Parent: f09ef2ba0c4f4e6fb7a28138c36e2c4c38816bf5
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Thu Feb 3 09:52:32 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Feb 3 09:52:32 2011 -0600
gfs2_edit: Fix bitmap editing function
The bitmap editing function wasn't reading in the rgrp, so that it
would fail with a NULL pointer dereference.
rhbz#656371
---
gfs2/edit/hexedit.c | 33 +++++++++++++++++++--------------
1 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index c4249e1..6604376 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -2572,23 +2572,28 @@ static void find_change_block_alloc(int *newval)
if (ablock == sbd.sb_addr)
printf("3 (the superblock is not in the bitmap)\n");
else {
- if (newval) {
- if (gfs2_set_bitmap(&sbd, ablock, *newval))
- printf("-1 (block invalid or part of an rgrp).\n");
- else
- printf("%d\n", *newval);
- } else {
- rgd = gfs2_blk2rgrpd(&sbd, ablock);
- if (rgd) {
- gfs2_rgrp_read(&sbd, rgd);
+ rgd = gfs2_blk2rgrpd(&sbd, ablock);
+ if (rgd) {
+ gfs2_rgrp_read(&sbd, rgd);
+ if (newval) {
+ if (gfs2_set_bitmap(&sbd, ablock, *newval))
+ printf("-1 (block invalid or part of an rgrp).\n");
+ else
+ printf("%d\n", *newval);
+ } else {
type = gfs2_get_bitmap(&sbd, ablock, rgd);
- gfs2_rgrp_relse(rgd);
+ if (type < 0) {
+ printf("-1 (block invalid or part of "
+ "an rgrp).\n");
+ exit(-1);
+ }
printf("%d (%s)\n", type, allocdesc[gfs1][type]);
- } else {
- gfs2_rgrp_free(&sbd.rglist);
- printf("-1 (block invalid or part of an rgrp).\n");
- exit(-1);
}
+ gfs2_rgrp_relse(rgd);
+ } else {
+ gfs2_rgrp_free(&sbd.rglist);
+ printf("-1 (block invalid or part of an rgrp).\n");
+ exit(-1);
}
}
gfs2_rgrp_free(&sbd.rglist);
13 years, 4 months
cluster: RHEL6 - fence_scsi: properly log errors for all commands
by rohara
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: b3e375c0554149173390b542de1ef3674da3d128
Parent: f5e2f9078450566f543eb03d22cf9078af9a9c07
Author: Ryan O'Hara <rohara(a)redhat.com>
AuthorDate: Tue Jan 25 11:16:10 2011 -0600
Committer: Ryan O'Hara <rohara(a)redhat.com>
CommitterDate: Wed Feb 2 20:41:15 2011 -0600
fence_scsi: properly log errors for all commands
There are a number of places in fence_scsi that call sg_persist commands
via Perl's qx command. If an error occurs, the script simply dies and
reports the name of the subroutine that the script died in. This can be
improved by replacing the die call with log_error, such that any errors
get properly written to the logfile, if any. This patch also logs the
error code returned from the failed command.
This patch also redirects stderr to /dev/null for all commands executed
via qx.
Signed-off-by: Ryan O'Hara <rohara(a)redhat.com>
Reviewed-by: Lon Hohberger <lhh(a)redhat.com>
---
fence/agents/scsi/fence_scsi.pl | 99 ++++++++++++++++++++++++++++++--------
1 files changed, 78 insertions(+), 21 deletions(-)
diff --git a/fence/agents/scsi/fence_scsi.pl b/fence/agents/scsi/fence_scsi.pl
index efeeba3..ae658ab 100644
--- a/fence/agents/scsi/fence_scsi.pl
+++ b/fence/agents/scsi/fence_scsi.pl
@@ -185,14 +185,20 @@ sub do_register ($$$)
my $cmd;
my $out;
+ my $err;
do_reset ($dev);
$cmd = "sg_persist -n -o -G -K $host_key -S $node_key -d $dev";
$cmd .= " -Z" if (defined $opt_a);
- $out = qx { $cmd };
+ $out = qx { $cmd 2> /dev/null };
+ $err = ($?>>8);
- die "[error]: $self\n" if ($?>>8);
+ if ($err != 0) {
+ log_error ("$self (err=$err)");
+ }
+
+ # die "[error]: $self\n" if ($?>>8);
return;
}
@@ -216,14 +222,20 @@ sub do_register_ignore ($$)
my $cmd;
my $out;
+ my $err;
do_reset ($dev);
$cmd = "sg_persist -n -o -I -S $node_key -d $dev";
$cmd .= " -Z" if (defined $opt_a);
- $out = qx { $cmd };
+ $out = qx { $cmd 2> /dev/null };
+ $err = ($?>>8);
- die "[error]: $self ($dev)\n" if ($?>>8);
+ if ($err != 0) {
+ log_error ("$self (err=$err)");
+ }
+
+ # die "[error]: $self ($dev)\n" if ($?>>8);
return;
}
@@ -236,9 +248,14 @@ sub do_reserve ($$)
log_debug ("$self (host_key=$host_key, dev=$dev)");
my $cmd = "sg_persist -n -o -R -T 5 -K $host_key -d $dev";
- my $out = qx { $cmd };
+ my $out = qx { $cmd 2> /dev/null };
+ my $err = ($?>>8);
- die "[error]: $self\n" if ($?>>8);
+ if ($err != 0) {
+ log_error ("$self (err=$err)");
+ }
+
+ # die "[error]: $self\n" if ($?>>8);
return;
}
@@ -251,9 +268,14 @@ sub do_release ($$)
log_debug ("$self (host_key=$host_key, dev=$dev)");
my $cmd = "sg_persist -n -o -L -T 5 -K $host_key -d $dev";
- my $out = qx { $cmd };
+ my $out = qx { $cmd 2> /dev/null };
+ my $err = ($?>>8);
- die "[error]: $self\n" if ($?>>8);
+ if ($err != 0) {
+ log_error ("$self (err=$err)");
+ }
+
+ # die "[error]: $self\n" if ($?>>8);
return;
}
@@ -266,9 +288,14 @@ sub do_preempt ($$$)
log_debug ("$self (host_key=$host_key, node_key=$node_key, dev=$dev)");
my $cmd = "sg_persist -n -o -P -T 5 -K $host_key -S $node_key -d $dev";
- my $out = qx { $cmd };
+ my $out = qx { $cmd 2> /dev/null };
+ my $err = ($?>>8);
+
+ if ($err != 0) {
+ log_error ("$self (err=$err)");
+ }
- die "[error]: $self\n" if ($?>>8);
+ # die "[error]: $self\n" if ($?>>8);
return;
}
@@ -281,9 +308,14 @@ sub do_preempt_abort ($$$)
log_debug ("$self (host_key=$host_key, node_key=$node_key, dev=$dev)");
my $cmd = "sg_persist -n -o -A -T 5 -K $host_key -S $node_key -d $dev";
- my $out = qx { $cmd };
+ my $out = qx { $cmd 2> /dev/null };
+ my $err = ($?>>8);
+
+ if ($err != 0) {
+ log_error ("$self (err=$err)");
+ }
- die "[error]: $self\n" if ($?>>8);
+ # die "[error]: $self\n" if ($?>>8);
return;
}
@@ -343,9 +375,14 @@ sub get_node_id ($)
my $node_id;
my $cmd = "cman_tool nodes -n $_[0] -F id";
- my $out = qx { $cmd };
+ my $out = qx { $cmd 2> /dev/null };
+ my $err = ($?>>8);
- die "[error]: $self\n" if ($?>>8);
+ if ($err != 0) {
+ log_error ("$self (err=$err)");
+ }
+
+ # die "[error]: $self\n" if ($?>>8);
chomp ($out);
@@ -360,9 +397,14 @@ sub get_cluster_id ()
my $cluster_id;
my $cmd = "cman_tool status";
- my @out = qx { $cmd };
+ my @out = qx { $cmd 2> /dev/null };
+ my $err = ($?>>8);
- die "[error]: $self\n" if ($?>>8);
+ if ($err != 0) {
+ log_error ("$self (err=$err)");
+ }
+
+ # die "[error]: $self\n" if ($?>>8);
foreach (@out) {
chomp;
@@ -388,8 +430,13 @@ sub get_devices_clvm ()
" devices { preferred_names = [ \"^/dev/dm\" ] }'";
my @out = qx { $cmd 2> /dev/null };
+ my $err = ($?>>8);
+
+ if ($err != 0) {
+ log_error ("$self (err=$err)");
+ }
- die "[error]: $self\n" if ($?>>8);
+ # die "[error]: $self\n" if ($?>>8);
foreach (@out) {
chomp;
@@ -479,9 +526,14 @@ sub get_registration_keys ($)
my @keys;
my $cmd = "sg_persist -n -i -k -d $dev";
- my @out = qx { $cmd };
+ my @out = qx { $cmd 2> /dev/null };
+ my $err = ($?>>8);
+
+ if ($err != 0) {
+ log_error ("$self (err=$err)");
+ }
- die "[error]: $self\n" if ($?>>8);
+ # die "[error]: $self\n" if ($?>>8);
foreach (@out) {
chomp;
@@ -500,9 +552,14 @@ sub get_reservation_key ($)
my $key;
my $cmd = "sg_persist -n -i -r -d $dev";
- my @out = qx { $cmd };
+ my @out = qx { $cmd 2> /dev/null };
+ my $err = ($?>>8);
+
+ if ($err != 0) {
+ log_error ("$self (err=$err)");
+ }
- die "[error]: $self\n" if ($?>>8);
+ # die "[error]: $self\n" if ($?>>8);
foreach (@out) {
chomp;
13 years, 4 months
cluster: RHEL6 - cman: Minor fixes for checkquorum script
by Chris Feist
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: f5e2f9078450566f543eb03d22cf9078af9a9c07
Parent: bedaeebc12fac2e5568249357835f210174f4240
Author: Chris Feist <cfeist(a)redhat.com>
AuthorDate: Tue Feb 1 15:06:36 2011 -0600
Committer: Chris Feist <cfeist(a)redhat.com>
CommitterDate: Wed Feb 2 16:04:42 2011 -0600
cman: Minor fixes for checkquorum script
Remove all references to self-fencing
Removed absolute path the binaries in checkquorum
Added missing uninstall information for SHAREDIRTEX
---
cman/scripts/checkquorum | 14 +++++++-------
make/uninstall.mk | 3 +++
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/cman/scripts/checkquorum b/cman/scripts/checkquorum
index 43cbc6d..61934cd 100755
--- a/cman/scripts/checkquorum
+++ b/cman/scripts/checkquorum
@@ -26,14 +26,14 @@ if (($#ARGV != -1) && ($ARGV[0] eq "repair")) {
if (!quorum()) {
if (has_quorum_already_been_formed()) {
- debug("Quorum has already existed, node can be self fenced!\n");
+ debug("Quorum has already existed, node can be rebooted!\n");
if (-e $timerfile) {
$tf = open (FILE, "$timerfile");
$time = <FILE>;
close (FILE);
$timediff = time() - $time;
if ($timediff >= $wait_time) {
- self_fence()
+ reboot()
} else {
$remaining = $wait_time - $timediff;
debug("Time has not exceeded wait time ($remaining seconds remaining).\n");
@@ -45,16 +45,16 @@ if (!quorum()) {
close (FILE);
}
} else {
- debug("This is a new startup no self-fencing will occur.\n");
+ debug("This is a new startup no reboot will occur.\n");
`rm -f $timerfile`;
}
} else {
- debug("Quorum exists, no self-fencing should occur.\n");
+ debug("Quorum exists, no reboot should occur.\n");
`rm -f $timerfile`;
}
sub has_quorum_already_been_formed {
- $oe = `/usr/sbin/corosync-objctl 2>&1 | grep -E "runtime.totem.pg.mrp.srp.operational_entered|Could not initialize objdb library|Cannot connect to quorum service" `;
+ $oe = `corosync-objctl 2>&1 | grep -E "runtime.totem.pg.mrp.srp.operational_entered|Could not initialize objdb library|Cannot connect to quorum service" `;
if ($oe =~ /^Could not/ || $oe =~ /^Cannot/) {
debug("corosync is not running\n");
exit 0;
@@ -79,8 +79,8 @@ sub quorum {
return 0;
}
-sub self_fence {
- debug("Self fencing commencing...\n");
+sub reboot {
+ debug("Reboot commencing...\n");
`rm -f $timerfile`;
if ($hardreboot == 1) {
`echo 1 > /proc/sys/kernel/sysrq`;
diff --git a/make/uninstall.mk b/make/uninstall.mk
index 786faca..bbf7edc 100644
--- a/make/uninstall.mk
+++ b/make/uninstall.mk
@@ -47,6 +47,9 @@ endif
ifdef PKGCONF
${UNINSTALL} ${PKGCONF} ${pkgconfigdir}
endif
+ifdef SHAREDIRTEX
+ ${UNINSTALL} ${SHAREDIRTEX} ${sharedir}
+endif
ifdef SHAREDIRT
${UNINSTALL} ${SHAREDIRT} ${sharedir}
endif
13 years, 4 months