gfs2-utils: master - gfs2_edit: Fix segfault in find by resource group
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitd...
Commit: 3b0d981b18e1d9c0126c80b14af2c922fe841465
Parent: 8d9c74306165491098c07dc19b79b6f2f9b9cc62
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Tue Sep 6 12:40:38 2011 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Tue Sep 6 13:51:51 2011 +0100
gfs2_edit: Fix segfault in find by resource group
When using 'find' on block types which require searching by resource
group, a segfault occurs in __gfs2_next_rg_meta due to rgd->bh being
empty. This patch fixes the segfault by reading in the resource group
data, thus populating rgd->bh, prior to the search.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/edit/hexedit.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c
index 2182704..dd0cf60 100644
--- a/gfs2/edit/hexedit.c
+++ b/gfs2/edit/hexedit.c
@@ -2056,7 +2056,7 @@ static uint64_t find_metablockoftype_slow(uint64_t startblk, int metatype, int p
static uint64_t find_metablockoftype_rg(uint64_t startblk, int metatype, int print)
{
struct osi_node *n, *next = NULL;
- uint64_t blk;
+ uint64_t blk, errblk;
int first = 1, found = 0;
struct rgrp_tree *rgd;
struct gfs2_rindex *ri;
@@ -2087,6 +2087,9 @@ static uint64_t find_metablockoftype_rg(uint64_t startblk, int metatype, int pri
for (; !found && n; n = next){
next = osi_next(n);
rgd = (struct rgrp_tree *)n;
+ errblk = gfs2_rgrp_read(&sbd, rgd);
+ if (errblk)
+ continue;
first = 1;
do {
if (gfs2_next_rg_metatype(&sbd, rgd, &blk, metatype,
@@ -2098,6 +2101,7 @@ static uint64_t find_metablockoftype_rg(uint64_t startblk, int metatype, int pri
}
first = 0;
} while (blk <= startblk);
+ gfs2_rgrp_relse(rgd);
}
if (!found)
blk = 0;
12 years, 7 months
gfs2-utils: master - gfs_controld: Remove dead code from loop()
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitd...
Commit: 8d9c74306165491098c07dc19b79b6f2f9b9cc62
Parent: cd62d322ba6bbaf07c657d00712f3405c8e74099
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Mon Sep 5 14:41:05 2011 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Tue Sep 6 13:51:51 2011 +0100
gfs_controld: Remove dead code from loop()
This patch removes an if statement where the true branch is never taken.
At this point in the code, poll_timeout could only be 500 or -1.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
group/gfs_controld/main.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/group/gfs_controld/main.c b/group/gfs_controld/main.c
index 252965a..aa38839 100644
--- a/group/gfs_controld/main.c
+++ b/group/gfs_controld/main.c
@@ -1286,9 +1286,6 @@ static void loop(void)
if (dmsetup_wait) {
if (poll_timeout == -1)
poll_timeout = 1000;
- } else {
- if (poll_timeout == 1000)
- poll_timeout = -1;
}
}
query_unlock();
12 years, 7 months
gfs2-utils: master - libgfs2: Remove dead code from gfs2_get_leaf
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitd...
Commit: cd62d322ba6bbaf07c657d00712f3405c8e74099
Parent: 2aee8d01cc735178c56d6b0ca51e8b63468171e3
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Sun Sep 4 14:05:31 2011 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Tue Sep 6 13:51:51 2011 +0100
libgfs2: Remove dead code from gfs2_get_leaf
The value of error is always 0 when this if statement is reached. This
patch removes it.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/fs_ops.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index c778564..d344bc4 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -1032,8 +1032,6 @@ int gfs2_get_leaf(struct gfs2_inode *dip, uint64_t leaf_no,
int error = 0;
*bhp = bread(dip->i_sbd, leaf_no);
- if (error)
- return error;
error = gfs2_check_meta(*bhp, GFS2_METATYPE_LF);
if(error)
brelse(*bhp);
12 years, 7 months
gfs2-utils: master - libgfs2: clean up some dead code in gfs2_writei
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitd...
Commit: 2aee8d01cc735178c56d6b0ca51e8b63468171e3
Parent: 269f178ff858e4124c7bd6606a8ccfe41ea5358a
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Thu Sep 1 14:25:01 2011 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Tue Sep 6 13:51:51 2011 +0100
libgfs2: clean up some dead code in gfs2_writei
This patch cleans up an error variable which was initialized to 0 and
then never changed, and a 'fail' section which could be replaced by a
return. It also removes the 'out' label which was only referenced from
the dead if-statement in the 'fail' section.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/gfs1.c | 11 +----------
1 files changed, 1 insertions(+), 10 deletions(-)
diff --git a/gfs2/libgfs2/gfs1.c b/gfs2/libgfs2/gfs1.c
index 2bd5282..4549959 100644
--- a/gfs2/libgfs2/gfs1.c
+++ b/gfs2/libgfs2/gfs1.c
@@ -181,11 +181,9 @@ int gfs1_writei(struct gfs2_inode *ip, char *buf, uint64_t offset,
int journaled = fs_is_jdata(ip);
const uint64_t start = offset;
int copied = 0;
- int error = 0;
if (!size)
- goto fail; /* Not really an error */
-
+ return 0;
if (!ip->i_di.di_height && /* stuffed */
((start + size) > (sdp->bsize - sizeof(struct gfs_dinode))))
@@ -243,7 +241,6 @@ int gfs1_writei(struct gfs2_inode *ip, char *buf, uint64_t offset,
offset = (journaled) ? sizeof(struct gfs2_meta_header) : 0;
}
- out:
if (ip->i_di.di_size < start + copied) {
bmodified(ip->i_bh);
ip->i_di.di_size = start + copied;
@@ -253,12 +250,6 @@ int gfs1_writei(struct gfs2_inode *ip, char *buf, uint64_t offset,
gfs2_dinode_out(&ip->i_di, ip->i_bh);
return copied;
-
- fail:
- if (copied)
- goto out;
-
- return error;
}
/* ------------------------------------------------------------------------ */
12 years, 7 months
gfs2-utils: master - gfs2_edit: Initialize metafds fully in savemetaopen
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitd...
Commit: 269f178ff858e4124c7bd6606a8ccfe41ea5358a
Parent: cc83b5b675e6e83dd0983ac96ddd9c6d4d1e36d3
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Thu Aug 25 12:49:48 2011 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Tue Sep 6 13:51:51 2011 +0100
gfs2_edit: Initialize metafds fully in savemetaopen
Coverity showed that savemetaopen() can return a metafd without
initializing the gzfd member. This isn't currently a problem as we only
use gzfd when it is set but this patch initializes the metafd fully to
avoid future problems.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/edit/savemeta.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 3a0e45e..9e5d111 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -211,7 +211,7 @@ static void warm_fuzzy_stuff(uint64_t wfsblock, int force)
*/
static struct metafd savemetaopen(char *out_fn, int gziplevel)
{
- struct metafd mfd;
+ struct metafd mfd = {-1, NULL, NULL, gziplevel};
char gzmode[3] = "w9";
char dft_fn[] = DFT_SAVE_FILE;
@@ -233,7 +233,6 @@ static struct metafd savemetaopen(char *out_fn, int gziplevel)
exit(1);
}
- mfd.gziplevel = gziplevel;
if (gziplevel > 0) {
gzmode[1] = '0' + gziplevel;
mfd.gzfd = gzdopen(mfd.fd, gzmode);
12 years, 7 months
cluster: RHEL58 - cman: fix multicast address in cman.5 man page
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 0b79766fc2af6b7815a7a3620027f48550728ea8
Parent: 81ee84ff36b08e9ff35d1c47daf087f9c37f9fe8
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Tue Sep 6 08:41:32 2011 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Tue Sep 6 10:27:42 2011 +0200
cman: fix multicast address in cman.5 man page
Resolves: rhbz#727492
Acked-by: Christine Caulfield <ccaulfie(a)redhat.com>
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/man/cman.5 | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cman/man/cman.5 b/cman/man/cman.5
index bfda3e4..0644295 100644
--- a/cman/man/cman.5
+++ b/cman/man/cman.5
@@ -110,7 +110,7 @@ It is possible to override the multicast address by specifying it in cluster.con
as shown:
<cman>
- <multicast addr="229.192.0.1"/>
+ <multicast addr="239.192.0.1"/>
</cman>
.in -7
12 years, 8 months
cluster: RHEL6 - cman: fix multicast address in cman.5 man page
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: c899e38f3dd412dd2f8263a301805312f54fbb60
Parent: 5bdd9f26b7664368a058dad1a76a7b668dd83632
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Tue Sep 6 08:41:32 2011 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Tue Sep 6 10:23:45 2011 +0200
cman: fix multicast address in cman.5 man page
Resolves: rhbz#735906
Acked-by: Christine Caulfield <ccaulfie(a)redhat.com>
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/man/cman.5 | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/cman/man/cman.5 b/cman/man/cman.5
index a4dbcfd..84c86be 100644
--- a/cman/man/cman.5
+++ b/cman/man/cman.5
@@ -104,7 +104,7 @@ Note that if you are using the DLM with cman/corosync then you MUST tell it
to use SCTP as it's communications protocol as TCP does not support multihoming.
<clusternode name="nd1" nodeid="1">
- <altname name="nd1a" port="6809" mcast="229.192.0.2"/>
+ <altname name="nd1a" port="6809" mcast="239.192.0.2"/>
</clusternode>
<dlm protocol="sctp"/>
@@ -125,7 +125,7 @@ It is possible to override the multicast address by specifying it in cluster.con
as shown:
<cman>
- <multicast addr="229.192.0.1"/>
+ <multicast addr="239.192.0.1"/>
</cman>
.in -7
12 years, 8 months
cluster: STABLE31 - cman: fix multicast address in cman.5 man page
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 3a796d7d5cce3c76ed145040a56e1bc445e70f83
Parent: e236677a5c238673a94923c34dcd4f83f4c9374b
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Tue Sep 6 08:41:32 2011 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Tue Sep 6 08:41:32 2011 +0200
cman: fix multicast address in cman.5 man page
Resolves: rhbz#735906
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/man/cman.5 | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/cman/man/cman.5 b/cman/man/cman.5
index a4dbcfd..84c86be 100644
--- a/cman/man/cman.5
+++ b/cman/man/cman.5
@@ -104,7 +104,7 @@ Note that if you are using the DLM with cman/corosync then you MUST tell it
to use SCTP as it's communications protocol as TCP does not support multihoming.
<clusternode name="nd1" nodeid="1">
- <altname name="nd1a" port="6809" mcast="229.192.0.2"/>
+ <altname name="nd1a" port="6809" mcast="239.192.0.2"/>
</clusternode>
<dlm protocol="sctp"/>
@@ -125,7 +125,7 @@ It is possible to override the multicast address by specifying it in cluster.con
as shown:
<cman>
- <multicast addr="229.192.0.1"/>
+ <multicast addr="239.192.0.1"/>
</cman>
.in -7
12 years, 8 months
cluster: RHEL6 - config: invalidate ccs_update_schema cache if we received traps/signals
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 5bdd9f26b7664368a058dad1a76a7b668dd83632
Parent: 5a0a299ea95d689d90da1d71aec88753d26efa5f
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Sat Sep 3 11:15:22 2011 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Mon Sep 5 15:34:36 2011 +0200
config: invalidate ccs_update_schema cache if we received traps/signals
Resolves: rhbz#733424
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
config/tools/xml/ccs_update_schema.in | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/config/tools/xml/ccs_update_schema.in b/config/tools/xml/ccs_update_schema.in
index 03dbb68..d082ed3 100644
--- a/config/tools/xml/ccs_update_schema.in
+++ b/config/tools/xml/ccs_update_schema.in
@@ -64,6 +64,7 @@ export tmpdir
# need to be careful (might have to mask traps on exit)
cleanup() {
+ [ "$1" != "0" ] && rm -f $vardir/*.cache $vardir/*.hash
[ -n "$tmpdir" ] && [ -d "$tmpdir" ] && rm -rf "$tmpdir"
rm -f $vardir/rng_update.lock
exit $1
12 years, 8 months
cluster: STABLE31 - config: invalidate ccs_update_schema cache if we received traps/signals
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: e236677a5c238673a94923c34dcd4f83f4c9374b
Parent: b694e7ab032697280ed330423b5200ae92b1c8db
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Sat Sep 3 11:15:22 2011 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Sat Sep 3 11:15:22 2011 +0200
config: invalidate ccs_update_schema cache if we received traps/signals
Resolves: rhbz#733424
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
config/tools/xml/ccs_update_schema.in | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/config/tools/xml/ccs_update_schema.in b/config/tools/xml/ccs_update_schema.in
index 03dbb68..d082ed3 100644
--- a/config/tools/xml/ccs_update_schema.in
+++ b/config/tools/xml/ccs_update_schema.in
@@ -64,6 +64,7 @@ export tmpdir
# need to be careful (might have to mask traps on exit)
cleanup() {
+ [ "$1" != "0" ] && rm -f $vardir/*.cache $vardir/*.hash
[ -n "$tmpdir" ] && [ -d "$tmpdir" ] && rm -rf "$tmpdir"
rm -f $vardir/rng_update.lock
exit $1
12 years, 8 months