File gfs2_convert_exists_with_success_without_doing_anything.patch of Package cluster

commit 508b868e8c22a4dc454a406d9a1c0a32af94c21e
Author: Abhijith Das <adas@redhat.com>
Date:   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@redhat.com>

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");