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

Abhijith Das adas at fedoraproject.org
Thu Nov 12 21:26:43 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=3f5a9f2d641a171344047d5f63b65d2c566ee168
Commit:        3f5a9f2d641a171344047d5f63b65d2c566ee168
Parent:        265c8cf123dca7bde745c9b10c13b95e1b3ce08f
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:26:13 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 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