Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=136be5fd39fc6…
Commit: 136be5fd39fc6a2f1a277e5f8c9be542e514a538
Parent: 6ab6b7c93a8868f5f95eea67fc3588af9e8c2a52
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Fri Aug 16 10:37:40 2013 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Fri Aug 16 10:40:01 2013 +0100
libgfs2: Set umask before calling mkstemp
Coverity highlighted a case where mkstemp() was being called without the
umask being set. This sets the umask to create the file with 0600
permissions and then restores it after mkstemp() is called.
rhbz#996233
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/misc.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c
index 6807f60..3989bf1 100644
--- a/gfs2/libgfs2/misc.c
+++ b/gfs2/libgfs2/misc.c
@@ -219,13 +219,16 @@ static void remove_mtab_entry(struct gfs2_sbd *sdp)
struct mntent *mountent;
char mtab_tmpfn[PATH_MAX];
int error, fd;
+ mode_t mask;
mtab = setmntent("/etc/mtab", "rt");
if (mtab == NULL)
die("Couldn't open /etc/mtab for writing: %s\n",
strerror(errno));
strcpy(mtab_tmpfn, "/etc/mtab.XXXXXX");
+ mask = umask(S_IXUSR | S_IRWXG | S_IRWXO);
fd = mkstemp(mtab_tmpfn);
+ umask(mask);
if (fd < 0)
die("Couldn't open temporary mtab file for writing: %s\n",
strerror(errno));
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=6ab6b7c93a886…
Commit: 6ab6b7c93a8868f5f95eea67fc3588af9e8c2a52
Parent: cac6df6f85e0fe776ef53750d93708223c6534d1
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Thu Aug 15 07:41:56 2013 -0500
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Aug 15 07:41:56 2013 -0500
libgfs2: Correct error message in mtab update code
If we encounter an error while trying to update the /etc/mtab file
the code was reporting that the problem in adding an entry. The
problem is, it's really trying to add the entries to the temp file,
which will be renamed to /etc/mtab, for the sake of removing an
entry from mtab. Therefore, I'm correcting the error message so that
it makes more sense.
rhbz#996233
---
gfs2/libgfs2/misc.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c
index f7fab7e..6807f60 100644
--- a/gfs2/libgfs2/misc.c
+++ b/gfs2/libgfs2/misc.c
@@ -240,14 +240,14 @@ static void remove_mtab_entry(struct gfs2_sbd *sdp)
continue;
error = addmntent(mtabnew, mountent);
if (error)
- die("Unable to add mount entry to mtab.\n");
+ die("Unable to remove mount entry from mtab.\n");
}
endmntent(mtab);
fclose(mtabnew);
close(fd);
if (rename(mtab_tmpfn, "/etc/mtab"))
- fprintf(stderr, "Unable to add mount entry to mtab.\n");
+ fprintf(stderr, "Unable to remove mount entry from mtab.\n");
}
void cleanup_metafs(struct gfs2_sbd *sdp)
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=b4408e050960c…
Commit: b4408e050960c35793afb33b6c589bf579252609
Parent: 3e4cddfa54bf3e5dcc2e94343df54dc15539138c
Author: Christine Caulfield <ccaulfie(a)redhat.com>
AuthorDate: Tue Aug 13 16:32:38 2013 +0100
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Tue Aug 13 16:32:38 2013 +0100
qdisk: Check that all nodes are running qdiskd and warn if not
At every cman poll, qdiskd now asks cman not only whether the
node is up, but also whether it it running a qdiskd. (more
accurately, it asks if anything is bound to the qdiskd
cman port). If any node is active in cman but NOT running
qdiskd then a warning is printed to syslog every 5 seconds.
rhbz#994187
Signed-off-by: Christine Caulfield <ccaulfie(a)redhat.com>
Acked-By: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/qdisk/main.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c
index 4d4397a..9dee134 100644
--- a/cman/qdisk/main.c
+++ b/cman/qdisk/main.c
@@ -632,6 +632,7 @@ check_cman(qd_ctx *ctx, memb_mask_t mask, memb_mask_t master_mask)
{
cman_node_t nodes[MAX_NODES_DISK];
int retnodes, x;
+ static unsigned int check_cycle = 0;
if (cman_get_nodes(ctx->qc_cman_admin, MAX_NODES_DISK,
&retnodes, nodes) <0 )
@@ -639,6 +640,18 @@ check_cman(qd_ctx *ctx, memb_mask_t mask, memb_mask_t master_mask)
memset(master_mask, 0, sizeof(memb_mask_t));
for (x = 0; x < retnodes; x++) {
+ /* See if the other node is running cman and not qdiskd.
+ Just to this every 4 times (seconds) so we don't spam syslog
+ too much. cman_is_listening() can return EBUSY which means
+ "I don't know". We don't worry about this, and just report
+ at the next check by which time it will.
+ */
+ check_cycle = (check_cycle + 1) % 4;
+ if ((check_cycle == 1) &&
+ (cman_is_listening(ctx->qc_cman_admin, nodes[x].cn_nodeid,
+ CLUSTER_PORT_QDISKD) == 0)) {
+ logt_print(LOG_NOTICE, "node %s is up but not running qdiskd", nodes[x].cn_name);
+ }
if (is_bit_set(mask, nodes[x].cn_nodeid-1, sizeof(memb_mask_t)) &&
nodes[x].cn_member) {
set_bit(master_mask, nodes[x].cn_nodeid-1,