cluster: STABLE3 - gfs2_convert: Fix rgrp conversion to allow re-converts
Fabio M. Di Nitto
fabbione at fedoraproject.org
Tue Dec 1 15:45:01 UTC 2009
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=ffac8749c3b2fa9057a2ada236d570bdaa15638d
Commit: ffac8749c3b2fa9057a2ada236d570bdaa15638d
Parent: 78c8e57048ad2c1be5df84efbcd067a5ddaf575e
Author: Abhijith Das <adas at redhat.com>
AuthorDate: Thu Nov 12 15:21:57 2009 -0600
Committer: Fabio M. Di Nitto <fdinitto at redhat.com>
CommitterDate: Tue Dec 1 16:44:46 2009 +0100
gfs2_convert: Fix rgrp conversion to allow re-converts
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.
---
gfs2/convert/gfs2_convert.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index bc6312d..260d543 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -209,6 +209,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);
More information about the cluster-commits
mailing list