cluster: RHEL58 - rgmanager: Fix stop/start race
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 0f070b75b0864ed4b46c361916f822b4a57a1a3f
Parent: 169ba7b72909720363dffab9993b3f3f586e6ae6
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Mon Jun 15 14:18:36 2009 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Wed Nov 9 12:33:49 2011 -0500
rgmanager: Fix stop/start race
If a thread exits right as rgmanager gets a request
to start a new thread, there's a chance that the
the starting thread will incorrectly have a reference
to the old thread and not retry when it should.
Resolves: rhbz#752486
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/daemons/rg_thread.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/rgmanager/src/daemons/rg_thread.c b/rgmanager/src/daemons/rg_thread.c
index b89af97..769ca1e 100644
--- a/rgmanager/src/daemons/rg_thread.c
+++ b/rgmanager/src/daemons/rg_thread.c
@@ -620,6 +620,8 @@ spawn_if_needed(const char *resgroupname)
int ret;
resthread_t *resgroup = NULL;
+retry:
+ resgroup = NULL;
pthread_mutex_lock(&reslist_mutex);
while (resgroup == NULL) {
resgroup = find_resthread_byname(resgroupname);
@@ -637,8 +639,8 @@ spawn_if_needed(const char *resgroupname)
ret = (resgroup->rt_status == RG_STATE_STOPPING);
pthread_mutex_unlock(&reslist_mutex);
- if (wait_initialize(resgroupname) < 0) {
- return -1;
+ if (!ret && wait_initialize(resgroupname) < 0) {
+ goto retry;
}
return ret;
12 years, 6 months
gfs2-utils: master - gfs_controld: don't ignore dlmc_fs_register error
by David Teigland
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitd...
Commit: 34c0872f1895924b94fe4ccf502c27ba97880792
Parent: c9ce73c2a3381f227024e44f1d7b04adc6de87c2
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Nov 11 14:30:44 2011 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Nov 11 14:35:42 2011 -0600
gfs_controld: don't ignore dlmc_fs_register error
gfs_controld ignores an error returned by dlm_controld for
dlmc_fs_register() during mount. This results in a successful
mount, but dlm/gfs recovery not being coordinated. The mount
should return an error instead.
bz 753300
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
group/gfs_controld/cpg-new.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/group/gfs_controld/cpg-new.c b/group/gfs_controld/cpg-new.c
index a72d0f1..8cf2b00 100644
--- a/group/gfs_controld/cpg-new.c
+++ b/group/gfs_controld/cpg-new.c
@@ -775,11 +775,12 @@ void process_dlmcontrol(int ci)
if (result) {
/* shouldn't happen */
log_error("process_dlmcontrol register %d", result);
- } else
+ client_reply_join_full(mg, result);
+ mg->mount_client_notified = 1;
+ } else {
log_group(mg, "process_dlmcontrol register %d", result);
-
- mg->dlm_registered = 1;
-
+ mg->dlm_registered = 1;
+ }
} else {
log_group(mg, "process_dlmcontrol unknown type %d", type);
}
12 years, 6 months
gfs2-utils: master - mkfs.gfs2: Some minor cleanups
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitd...
Commit: c9ce73c2a3381f227024e44f1d7b04adc6de87c2
Parent: 5b2c8e2e8bd72d54da60f84bfc3e119826e0e610
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Nov 7 13:58:12 2011 +0000
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Mon Nov 7 13:58:12 2011 +0000
mkfs.gfs2: Some minor cleanups
- The -K option isn't currently parsed, add it to the getopt option
string.
- Variable 'input' is defined but not used, remove it.
- Add back reporting of the current device contents.
- Don't call the discard blocks ioctl on regular files.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/mkfs/main_mkfs.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
index 6de1d12..eeff47b 100644
--- a/gfs2/mkfs/main_mkfs.c
+++ b/gfs2/mkfs/main_mkfs.c
@@ -109,7 +109,7 @@ static void decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp)
sdp->orig_fssize = 0;
while (cont) {
- optchar = getopt(argc, argv, "-b:c:DhJ:j:Op:qr:t:u:VX");
+ optchar = getopt(argc, argv, "-b:c:DhJ:j:KOp:qr:t:u:VX");
switch (optchar) {
case 'b':
@@ -325,7 +325,6 @@ static void are_you_sure(void)
static void verify_bsize(struct gfs2_sbd *sdp)
{
unsigned int x;
- char input[32];
/* Block sizes must be a power of two from 512 to 65536 */
@@ -561,8 +560,11 @@ void main_mkfs(int argc, char *argv[])
exit(EXIT_FAILURE);
}
- if (!sdp->override)
+ if (!sdp->override) {
+ printf( _("This will destroy any data on %s.\n"), sdp->device_name);
+ check_dev_content(sdp->device_name);
are_you_sure();
+ }
if (!S_ISREG(st_buf.st_mode) && device_topology(sdp)) {
perror(_("Device topology error\n"));
@@ -621,7 +623,7 @@ void main_mkfs(int argc, char *argv[])
exit(EXIT_FAILURE);
}
- if (discard)
+ if (!S_ISREG(st_buf.st_mode) && discard)
discard_blocks(sdp);
/* Compute the resource group layouts */
12 years, 6 months