gfs2-utils: master - fsck.gfs2: Fix infinite loop in pass1b caused by duplicates in hash table
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=3006c68f...
Commit: 3006c68feb0da6f26d00ade419af0b8d3be30ef1
Parent: 3dc6d9035a2972581f0cb442163ffd0e0ee93868
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Mon Jul 15 14:01:16 2013 -0500
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Wed Jul 17 07:31:36 2013 -0500
fsck.gfs2: Fix infinite loop in pass1b caused by duplicates in hash table
If directory leaf blocks appeared more than once in a directory hash
table, the duplicate references would be flagged as a duplicate,
but since the duplicates were all from the same directory dinode,
pass1b would not realize it needed to stop. This patch changes the
criteria for duplicate processing so that it stops when the references
are down to a single dinode, not a single reference. This allows
it to get beyond pass1b so that the problem can be fixed by the hash
table checking code in pass2.
rhbz#984085
---
gfs2/fsck/pass1b.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c
index 0dcb306..e3da20a 100644
--- a/gfs2/fsck/pass1b.c
+++ b/gfs2/fsck/pass1b.c
@@ -368,11 +368,11 @@ static int handle_dup_blk(struct gfs2_sbd *sdp, struct duptree *dt)
/* If there's still a last remaining reference, and it's a valid
reference, use it to determine the correct block type for our
blockmap and bitmap. */
- if (dh.ref_count == 1 && !osi_list_empty(&dt->ref_inode_list)) {
+ if (dh.ref_inode_count == 1 && !osi_list_empty(&dt->ref_inode_list)) {
uint8_t q;
log_notice( _("Block %llu (0x%llx) has only one remaining "
- "valid reference.\n"),
+ "valid inode referencing it.\n"),
(unsigned long long)dup_blk,
(unsigned long long)dup_blk);
/* If we're down to a single reference (and not all references
10 years, 9 months
gfs2-utils: master - fsck.gfs2: Fix directory link on relocated directory dirents
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=3dc6d903...
Commit: 3dc6d9035a2972581f0cb442163ffd0e0ee93868
Parent: 8c20e8e200ae3ab546f69a49040fbb0a317c1b59
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Mon Jul 15 13:50:21 2013 -0500
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Wed Jul 17 07:31:36 2013 -0500
fsck.gfs2: Fix directory link on relocated directory dirents
There was a problem whereby fsck.gfs2 would discover a directory entry
that's on the wrong leaf block (the dirent's hash value doesn't fit
the acceptable range for that leaf block). In that case, fsck would
relocate the dirent to an appropriate leaf block. The problem is, if
that dirent was for a directory, the directory link count was adjusted
appropriately, but it was not properly added to the directory linkage
due to the fact that it took an error path in order to delete the
dirent that was relocated. This resulted in a problem when pass3 went
to verify the directory linkage. Despite the intact directory linkage,
it flagged the directory as not linked, then it improperly added it
to lost+found. Subsequent fsck.gfs2 would discover the double-linkage
problems.
rhbz#984085
---
gfs2/fsck/pass2.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/gfs2/fsck/pass2.c b/gfs2/fsck/pass2.c
index fb15eae..dabfc13 100644
--- a/gfs2/fsck/pass2.c
+++ b/gfs2/fsck/pass2.c
@@ -391,7 +391,18 @@ static int wrong_leaf(struct gfs2_inode *ip, struct gfs2_inum *entry,
leaf, but that leaf has already been processed. So we have
to nuke the dent from this leaf when we return, but we
still need to do the "good dent" accounting. */
- error = incr_link_count(*entry, ip, _("valid reference"));
+ if (de->de_type == (sdp->gfs1 ? GFS_FILE_DIR : DT_DIR)) {
+ error = set_parent_dir(sdp, de->de_inum,
+ ip->i_di.di_num);
+ if (error > 0)
+ /* This is a bit of a kludge, but returning 0
+ in this case causes the caller to go through
+ function set_parent_dir a second time and
+ deal properly with the hard link. */
+ return 0;
+ }
+ error = incr_link_count(*entry, ip,
+ _("moved valid reference"));
if (error > 0 &&
bad_formal_ino(ip, dent, *entry, tmp_name, q, de, bh) == 1)
return 1; /* nuke it */
10 years, 9 months
gfs2-utils: master - fsck.gfs2: fix some log messages
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=8c20e8e2...
Commit: 8c20e8e200ae3ab546f69a49040fbb0a317c1b59
Parent: e348a0e860cbaab7e48822b646cc5ac6cfe4ff81
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Mon Jul 15 13:43:43 2013 -0500
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Wed Jul 17 07:31:36 2013 -0500
fsck.gfs2: fix some log messages
This patch fixes two messages: First, there's a place where it was
supposed to print a value in hexadecimal, but it printed in decimal.
Second, there's a place where it failed to print a newline.
rhbz#984085
---
gfs2/fsck/pass2.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gfs2/fsck/pass2.c b/gfs2/fsck/pass2.c
index 3d0bb49..fb15eae 100644
--- a/gfs2/fsck/pass2.c
+++ b/gfs2/fsck/pass2.c
@@ -1423,7 +1423,7 @@ static int check_hash_tbl(struct gfs2_inode *ip, uint64_t *tbl,
continue;
log_err(_("Dinode %llu (0x%llx) has a hash table "
- "inconsistency at index %d (0x%d) for %d\n"),
+ "inconsistency at index %d (0x%x) for %d\n"),
(unsigned long long)ip->i_di.di_num.no_addr,
(unsigned long long)ip->i_di.di_num.no_addr,
i, i, len);
@@ -1442,7 +1442,7 @@ static int check_hash_tbl(struct gfs2_inode *ip, uint64_t *tbl,
proper_len = 1 << (ip->i_di.di_depth - leaf.lf_depth);
if (proper_len != len) {
log_debug(_("Length 0x%x is not proper for "
- "leaf %llu (0x%llx): 0x%x"),
+ "leaf %llu (0x%llx): 0x%x\n"),
len, (unsigned long long)leafblk,
(unsigned long long)leafblk,
proper_len);
10 years, 9 months
fence-agents: master - fencing: fix attribute --login to --username
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=cff73b...
Commit: cff73b867e9e39d4161d825192b0d295751ba968
Parent: 3b6970b97f729d60adfa728dcda67367c5e23057
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Wed Jul 17 10:19:19 2013 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Wed Jul 17 10:19:19 2013 +0200
fencing: fix attribute --login to --username
Resolves: rhbz#984975
---
fence/agents/eps/fence_eps.py | 4 ++--
fence/agents/rhevm/fence_rhevm.py | 2 +-
fence/agents/xenapi/fence_xenapi.py | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/fence/agents/eps/fence_eps.py b/fence/agents/eps/fence_eps.py
index dfb0b5b..0e7709d 100644
--- a/fence/agents/eps/fence_eps.py
+++ b/fence/agents/eps/fence_eps.py
@@ -35,12 +35,12 @@ def eps_run_command(options, params):
eps_log(options, "GET "+request_str+"\n")
conn.putrequest('GET', request_str)
- if (options.has_key("--login")):
+ if (options.has_key("--username")):
if (not options.has_key("--password")):
options["--password"] = "" # Default is empty password
# String for Authorization header
- auth_str = 'Basic ' + string.strip(base64.encodestring(options["--login"]+':'+options["--password"]))
+ auth_str = 'Basic ' + string.strip(base64.encodestring(options["--username"]+':'+options["--password"]))
eps_log(options, "Authorization:"+auth_str+"\n")
conn.putheader('Authorization', auth_str)
diff --git a/fence/agents/rhevm/fence_rhevm.py b/fence/agents/rhevm/fence_rhevm.py
index f4c490f..d7fc326 100644
--- a/fence/agents/rhevm/fence_rhevm.py
+++ b/fence/agents/rhevm/fence_rhevm.py
@@ -82,7 +82,7 @@ def send_command(opt, command, method = "GET"):
c.setopt(pycurl.URL, url)
c.setopt(pycurl.HTTPHEADER, [ "Content-type: application/xml", "Accept: application/xml" ])
c.setopt(pycurl.HTTPAUTH, pycurl.HTTPAUTH_BASIC)
- c.setopt(pycurl.USERPWD, opt["--login"] + ":" + opt["--password"])
+ c.setopt(pycurl.USERPWD, opt["--username"] + ":" + opt["--password"])
c.setopt(pycurl.TIMEOUT, int(opt["--shell-timeout"]))
c.setopt(pycurl.SSL_VERIFYPEER, 0)
c.setopt(pycurl.SSL_VERIFYHOST, 0)
diff --git a/fence/agents/xenapi/fence_xenapi.py b/fence/agents/xenapi/fence_xenapi.py
index de42c6c..7ba8533 100644
--- a/fence/agents/xenapi/fence_xenapi.py
+++ b/fence/agents/xenapi/fence_xenapi.py
@@ -130,7 +130,7 @@ def get_outlet_list(session, options):
# Function to initiate the XenServer session via the XenAPI library.
def connect_and_login(options):
url = options["--session-url"]
- username = options["--login"]
+ username = options["--username"]
password = options["--passwd"]
try:
10 years, 9 months
fence-agents: RHEL6 - fence_ipmilan: New symlink fence_ilo4
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=88ee1b...
Commit: 88ee1bcc4dc0cf16b4144cbce4585ee4b852691c
Parent: 2acb7fe7fb97ba27b31f50442dd886be0e929e1b
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Wed Jul 10 11:02:32 2013 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Mon Jul 15 21:42:22 2013 +0200
fence_ipmilan: New symlink fence_ilo4
For HP iLO4, there is no need to have a power wait and only 'lanplus' option is required.
Resolves: rhbz#870269
---
fence/agents/ipmilan/Makefile.am | 2 +-
fence/agents/ipmilan/ipmilan.c | 3 +++
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/fence/agents/ipmilan/Makefile.am b/fence/agents/ipmilan/Makefile.am
index c4fc636..9e71858 100644
--- a/fence/agents/ipmilan/Makefile.am
+++ b/fence/agents/ipmilan/Makefile.am
@@ -2,7 +2,7 @@ MAINTAINERCLEANFILES = Makefile.in
TARGET = fence_ipmilan
-SYMTARGET = fence_ilo3 fence_imm fence_idrac
+SYMTARGET = fence_ilo3 fence_ilo4 fence_imm fence_idrac
sbin_PROGRAMS = $(TARGET)
diff --git a/fence/agents/ipmilan/ipmilan.c b/fence/agents/ipmilan/ipmilan.c
index 1eb733e..4d286ea 100644
--- a/fence/agents/ipmilan/ipmilan.c
+++ b/fence/agents/ipmilan/ipmilan.c
@@ -904,6 +904,7 @@ static void print_xml_metadata(char *pname) {
printf("%s\n","<?xml version=\"1.0\" ?>");
printf("%s%s%s\n","<resource-agent name=\"",pname,"\" shortdesc=\"Fence agent for IPMI over LAN\">");
printf("<symlink name=\"fence_ilo3\" shortdesc=\"Fence agent for HP iLO3\"/>\n");
+ printf("<symlink name=\"fence_ilo4\" shortdesc=\"Fence agent for HP iLO4\"/>\n");
printf("<symlink name=\"fence_idrac\" shortdesc=\"Fence agent for Dell iDRAC\"/>\n");
printf("<symlink name=\"fence_imm\" shortdesc=\"Fence agent for IBM Integrated Management Module\"/>\n");
printf("<longdesc>\n");
@@ -985,6 +986,8 @@ main(int argc, char **argv)
lanplus = 1;
down_sleep = 4;
strncpy(method, "cycle\0", 6);
+ } else if (!strcmp(pname, "fence_ilo4")) {
+ lanplus = 1;
}
if (argc > 1) {
10 years, 9 months
fence-agents: master - fence_ipmilan: New symlink fence_ilo4
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=3b6970...
Commit: 3b6970b97f729d60adfa728dcda67367c5e23057
Parent: c6d8c625c33451990473fef5ee735b18e28cdad1
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Wed Jul 10 11:02:32 2013 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Wed Jul 10 11:02:32 2013 +0200
fence_ipmilan: New symlink fence_ilo4
For HP iLO4, there is no need to have a power wait and only 'lanplus' option is required.
Resolves: rhbz#870269
---
fence/agents/ipmilan/Makefile.am | 2 +-
fence/agents/ipmilan/ipmilan.c | 3 +++
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/fence/agents/ipmilan/Makefile.am b/fence/agents/ipmilan/Makefile.am
index c4fc636..9e71858 100644
--- a/fence/agents/ipmilan/Makefile.am
+++ b/fence/agents/ipmilan/Makefile.am
@@ -2,7 +2,7 @@ MAINTAINERCLEANFILES = Makefile.in
TARGET = fence_ipmilan
-SYMTARGET = fence_ilo3 fence_imm fence_idrac
+SYMTARGET = fence_ilo3 fence_ilo4 fence_imm fence_idrac
sbin_PROGRAMS = $(TARGET)
diff --git a/fence/agents/ipmilan/ipmilan.c b/fence/agents/ipmilan/ipmilan.c
index 1eb733e..4d286ea 100644
--- a/fence/agents/ipmilan/ipmilan.c
+++ b/fence/agents/ipmilan/ipmilan.c
@@ -904,6 +904,7 @@ static void print_xml_metadata(char *pname) {
printf("%s\n","<?xml version=\"1.0\" ?>");
printf("%s%s%s\n","<resource-agent name=\"",pname,"\" shortdesc=\"Fence agent for IPMI over LAN\">");
printf("<symlink name=\"fence_ilo3\" shortdesc=\"Fence agent for HP iLO3\"/>\n");
+ printf("<symlink name=\"fence_ilo4\" shortdesc=\"Fence agent for HP iLO4\"/>\n");
printf("<symlink name=\"fence_idrac\" shortdesc=\"Fence agent for Dell iDRAC\"/>\n");
printf("<symlink name=\"fence_imm\" shortdesc=\"Fence agent for IBM Integrated Management Module\"/>\n");
printf("<longdesc>\n");
@@ -985,6 +986,8 @@ main(int argc, char **argv)
lanplus = 1;
down_sleep = 4;
strncpy(method, "cycle\0", 6);
+ } else if (!strcmp(pname, "fence_ilo4")) {
+ lanplus = 1;
}
if (argc > 1) {
10 years, 9 months
cluster: STABLE32 - rgmanager: Fix unlikely NULL ptr deref
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=3e4cddfa54b...
Commit: 3e4cddfa54bf3e5dcc2e94343df54dc15539138c
Parent: 75e0fd65e8713689585781724628cf69dfed4a92
Author: Ryan McCabe <rmccabe(a)redhat.com>
AuthorDate: Fri Jul 12 15:46:27 2013 -0400
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Fri Jul 12 15:46:27 2013 -0400
rgmanager: Fix unlikely NULL ptr deref
Fix a couple of places where a very unlikely null pointer
dereference could occur.
Related: rhbz#983296
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/clulib/vft.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/rgmanager/src/clulib/vft.c b/rgmanager/src/clulib/vft.c
index 6013575..8638cd4 100644
--- a/rgmanager/src/clulib/vft.c
+++ b/rgmanager/src/clulib/vft.c
@@ -498,6 +498,9 @@ vf_buffer_join_msg(vf_msg_t *hdr, struct timeval *timeout)
hdr->vm_msg.vf_view,
hdr->vm_msg.vf_data, hdr->vm_msg.vf_datalen);
+ if (!newp)
+ return 0;
+
if (timeout && (timeout->tv_sec || timeout->tv_usec)) {
if (getuptime(&newp->vn_timeout) == -1) {
/* XXX What do we do here? */
@@ -775,6 +778,7 @@ vf_try_commit(key_node_t *key_node)
*/
if (key_node->kn_data == NULL) {
fprintf (stderr, "malloc fail err=%d\n", errno);
+ key_node->kn_datalen = 0;
return -1;
}
10 years, 9 months
cluster: STABLE32 - rgmanger: Don't destroy locked mutexes
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=75e0fd65e87...
Commit: 75e0fd65e8713689585781724628cf69dfed4a92
Parent: 156a32063baa99fefdb445c68111b174dc06753e
Author: Ryan McCabe <rmccabe(a)redhat.com>
AuthorDate: Fri Jul 12 15:42:45 2013 -0400
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Fri Jul 12 15:42:45 2013 -0400
rgmanger: Don't destroy locked mutexes
Unlock locked mutexes before calling pthread_mutex_destroy()
on them.
Related: rhbz#983296
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/clulib/libcpglock.c | 1 +
rgmanager/src/daemons/rg_thread.c | 18 +++++-------------
2 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/rgmanager/src/clulib/libcpglock.c b/rgmanager/src/clulib/libcpglock.c
index f99edd4..75fc9f6 100644
--- a/rgmanager/src/clulib/libcpglock.c
+++ b/rgmanager/src/clulib/libcpglock.c
@@ -279,6 +279,7 @@ cpg_lock_fin(void *handle)
close(h->fd);
+ pthread_mutex_unlock(&h->mutex);
pthread_mutex_destroy(&h->mutex);
free(h);
return 0;
diff --git a/rgmanager/src/daemons/rg_thread.c b/rgmanager/src/daemons/rg_thread.c
index 4f46c25..1d7b1fb 100644
--- a/rgmanager/src/daemons/rg_thread.c
+++ b/rgmanager/src/daemons/rg_thread.c
@@ -533,20 +533,12 @@ resgroup_thread_main(void *arg)
}
*/
+ pthread_mutex_unlock(&my_queue_mutex);
mystatus = pthread_mutex_destroy(&my_queue_mutex);
- if (mystatus != 0)
- {
- if (mystatus == EBUSY) {
- pthread_mutex_unlock(&my_queue_mutex);
- }
-
- mystatus = pthread_mutex_destroy(&my_queue_mutex);
- if (mystatus != 0) {
- fprintf (stderr, "mutex_destroy=%d err=%d %p\n",
- mystatus, errno, &my_queue_mutex);
-
- fflush (stderr);
- }
+ if (mystatus != 0) {
+ fprintf(stderr, "mutex_destroy=%d err=%d %p\n",
+ mystatus, errno, &my_queue_mutex);
+ fflush (stderr);
}
list_remove(&resthread_list, myself);
10 years, 9 months
cluster: STABLE32 - rgmanager: Fix for double pthread_mutex_unlock() calls
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=156a32063ba...
Commit: 156a32063baa99fefdb445c68111b174dc06753e
Parent: c77921e6dd8186ffc80b9e3422f3b098d0b778a2
Author: Ryan McCabe <rmccabe(a)redhat.com>
AuthorDate: Fri Jul 12 15:36:35 2013 -0400
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Fri Jul 12 15:36:35 2013 -0400
rgmanager: Fix for double pthread_mutex_unlock() calls
Fix a few places where pthread_mutex_unlock() could be called
on an unlocked mutex.
Resolves: rhbz#983296
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/clulib/vft.c | 4 ++--
rgmanager/src/daemons/rg_event.c | 5 ++---
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/rgmanager/src/clulib/vft.c b/rgmanager/src/clulib/vft.c
index 0a97c61..6013575 100644
--- a/rgmanager/src/clulib/vft.c
+++ b/rgmanager/src/clulib/vft.c
@@ -1000,7 +1000,6 @@ vf_key_init_nt(const char *keyid, int timeout, vf_vote_cb_t vote_cb,
newnode = kn_find_key(keyid);
if (newnode) {
printf("Key %s already initialized\n", keyid);
- pthread_mutex_unlock(&key_list_mutex);
return -1;
}
@@ -1008,7 +1007,6 @@ vf_key_init_nt(const char *keyid, int timeout, vf_vote_cb_t vote_cb,
if (newnode == NULL) {
fprintf(stderr, "malloc fail3 err=%d\n", errno);
- pthread_mutex_unlock(&key_list_mutex);
return -1;
}
@@ -1487,6 +1485,8 @@ vf_read(cluster_member_list_t *membership, const char *keyid, uint64_t *view,
pthread_mutex_unlock(&vf_mutex);
return l;
}
+
+ pthread_mutex_lock(&key_list_mutex);
}
if (key_node->kn_datalen && key_node->kn_data) {
diff --git a/rgmanager/src/daemons/rg_event.c b/rgmanager/src/daemons/rg_event.c
index 2b78b49..028741f 100644
--- a/rgmanager/src/daemons/rg_event.c
+++ b/rgmanager/src/daemons/rg_event.c
@@ -338,9 +338,8 @@ event_master(void)
//logt_print(LOG_DEBUG, "%d is master\n", mi->m_nodeid);
goto out;
}
- }
-
- pthread_mutex_unlock(&mi_mutex);
+ } else
+ pthread_mutex_unlock(&mi_mutex);
memset(&_master_lock, 0, sizeof(_master_lock));
if (clu_lock(LKM_EXMODE, &_master_lock, LKF_NOQUEUE,
10 years, 9 months
cluster: RHEL62 - cman init: fix handling of lock file
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=bdaa8d1ce44...
Commit: bdaa8d1ce44b5bed9f32da2c27ff934989815046
Parent: 9b6944ca86fcad4de783fb7ce378338992ef3e69
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Thu Jul 11 09:48:00 2013 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Thu Jul 11 10:15:32 2013 +0200
cman init: fix handling of lock file
missing handling of lock file in operations other than start/stop
could lead in a situation where cman was running without
a lock file.
Resolves: rhbz#982698
Original patch by Shane Bradley <sbradley(a)redhat.com>
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/init.d/cman.in | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index a50f7be..3e5f881 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -736,13 +736,13 @@ start()
none \
"Mounting configfs"
- [ "$breakpoint" = "setup" ] && exit 0
+ [ "$breakpoint" = "setup" ] && return 0
runwrap start_cman \
none \
"Starting cman"
- [ "$breakpoint" = "join" ] && exit 0
+ [ "$breakpoint" = "join" ] && return 0
runwrap start_qdiskd \
qdiskd_enabled \
@@ -752,7 +752,7 @@ start()
none \
"Waiting for quorum"
- [ "$breakpoint" = "quorum" ] && exit 0
+ [ "$breakpoint" = "quorum" ] && return 0
runwrap start_groupd \
groupd_enabled \
@@ -778,7 +778,7 @@ start()
cmannotifyd_enabled \
"Starting cmannotifyd"
- [ "$breakpoint" = "daemons" ] && exit 0
+ [ "$breakpoint" = "daemons" ] && return 0
runwrap unfence_self \
none \
@@ -906,14 +906,14 @@ stop)
;;
restart|reload|force-reload)
cmanremove=remove
- stop
- start
+ stop && rm -f $LOCK_FILE
+ start && touch $LOCK_FILE
;;
condrestart|try-restart)
if cmanstatus; then
cmanremove=remove
- stop
- start
+ stop && rm -f $LOCK_FILE
+ start && touch $LOCK_FILE
fi
;;
status)
10 years, 10 months