gfs2-utils: master - gfs2_convert: exits with success without doing anything

Abhijith Das adas at fedoraproject.org
Mon Mar 21 16:32:32 UTC 2011


Gitweb:        http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=ae17f725f37fccaf59087994b54ffdcdb782fa81
Commit:        ae17f725f37fccaf59087994b54ffdcdb782fa81
Parent:        f6e1c345d7cce3d5ceedf2b19868b5d6a008ea2c
Author:        Abhijith Das <adas at redhat.com>
AuthorDate:    Mon Mar 21 11:27:55 2011 -0500
Committer:     Abhijith Das <adas at redhat.com>
CommitterDate: Mon Mar 21 11:27:55 2011 -0500

gfs2_convert: exits with success without doing anything

A recent gfs2-utils patch  added a sanity check (gfs2_check_range())
to the codepath of gfs1_ri_update() that's used by gfs2_convert.
This new check requires the value of sbp->fssize to be initialized
to a valid non-zero size, which gfs2_convert does not do. The check
fails and gfs2_convert bails out. This patch initializes sbp->fssize
to the device size and the check is successful and gfs2_convert runs
to completion as expected.

Resolves: rhbz#688734
Signed-off-by: Abhi Das <adas at redhat.com>
---
 gfs2/convert/gfs2_convert.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index b56eec2..98876ae 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -1502,6 +1502,7 @@ static int init(struct gfs2_sbd *sbp)
 	sbp->dinodes_alloced = 0; /* dinodes allocated - total them up later */
 	sbp->sd_sb.sb_bsize = GFS2_DEFAULT_BSIZE;
 	sbp->bsize = sbp->sd_sb.sb_bsize;
+	sbp->fssize = lseek(sbp->device_fd, 0, SEEK_END) / sbp->sd_sb.sb_bsize;
 	osi_list_init(&sbp->rglist);
 	if (compute_constants(sbp)) {
 		log_crit("Error: Bad constants (1)\n");


More information about the cluster-commits mailing list