commit 3e342bdbf969d977b0a1b09c8bb8ecdbeb04369b Author: Abhijith Das <adas@redhat.com> Date: Mon Dec 21 11:41:45 2009 -0600 gfs2_convert: interrupted rgrp conversion does not allow re-converts Resolves bz 548585. Zero out gfs1 rgrp's rg_freemeta field after adding it to gfs2 rgrp's free blocks. This should only be done once. If convert fails or is interrupted and is restarted later on, adding a non-zero rg_freemeta to the free blocks again throws off the numbers and breaks allocation. Resolves: rhbz#548585 diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c index 1b4b1bd..e624ace 100644 --- a/gfs2/convert/gfs2_convert.c +++ b/gfs2/convert/gfs2_convert.c @@ -219,6 +219,9 @@ static int convert_rgs(struct gfs2_sbd *sbp) /* rg_freemeta is a gfs1 structure, so libgfs2 doesn't know to */ /* convert from be to cpu. We must do it now. */ rgd->rg.rg_free = rgd1->rg_free + be32_to_cpu(rgd1->rg_freemeta); + /* Zero it out so we don't add it again in case something breaks */ + /* later on in the process and we have to re-run convert */ + rgd1->rg_freemeta = 0; sbp->blks_total += rgd->ri.ri_data; sbp->blks_alloced += (rgd->ri.ri_data - rgd->rg.rg_free);