LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File gfs2_convert_exists_with_success_without_doing_anything_part2.patch of Package cluster (Project home:sschapiro:openstack:upstream)

commit e468b6f6588d22f22b3329deaaf62bea014e4a2e
Author: Abhijith Das <adas@redhat.com>
Date:   Mon Mar 21 17:23:20 2011 -0500

    gfs2_convert exits with success without doing anything
    
    This is a correction to the previous patch that worked only for
    the default 4K blocksizes because the internal blocksize value
    was not yet updated with the actual value from the ondisk gfs1
    superblock.
    
    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 2b8f487..9cc3258 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -1498,7 +1498,6 @@ 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");
@@ -1514,6 +1513,7 @@ static int init(struct gfs2_sbd *sbp)
 	rindex_addr = be64_to_cpu(raw_gfs1_ondisk_sb.sb_rindex_di.no_addr);
 
 	sbp->bsize = sbp->sd_sb.sb_bsize;
+	sbp->fssize = lseek(sbp->device_fd, 0, SEEK_END) / sbp->sd_sb.sb_bsize;
 	sbp->sd_inptrs = (sbp->bsize - sizeof(struct gfs_indirect)) /
 		sizeof(uint64_t);
 	sbp->sd_diptrs = (sbp->bsize - sizeof(struct gfs_dinode)) /