cluster: RHEL55 - gfs2_convert: Fix rgrp conversion to allow re-converts

Abhijith Das adas at fedoraproject.org
Thu Nov 12 21:25:11 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=59e7e7853e276381cf1ab1654f0907647c90a105
Commit:        59e7e7853e276381cf1ab1654f0907647c90a105
Parent:        f81a8d2891bcd679b31a15f4cf3976932c58df05
Author:        Abhijith Das <adas at redhat.com>
AuthorDate:    Thu Nov 12 15:21:57 2009 -0600
Committer:     Abhijith Das <adas at redhat.com>
CommitterDate: Thu Nov 12 15:21:57 2009 -0600

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


More information about the cluster-commits mailing list