Gitweb:
http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 508b868e8c22a4dc454a406d9a1c0a32af94c21e
Parent: ecf02d5c3fac9cc8fbd4aa03f495a734c930e143
Author: Abhijith Das <adas(a)redhat.com>
AuthorDate: Mon Mar 21 11:35:46 2011 -0500
Committer: Abhijith Das <adas(a)redhat.com>
CommitterDate: Mon Mar 21 11:35:46 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(a)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 e71a00c..2b8f487 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -1498,6 +1498,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");