cluster: RHEL55 - gfs2_convert: interrupted rgrp conversion does not allow re-converts
Abhijith Das
adas at fedoraproject.org
Mon Dec 21 17:39:58 UTC 2009
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=84babaef6376740c882ef1f51ce0b8cf9f15abba
Commit: 84babaef6376740c882ef1f51ce0b8cf9f15abba
Parent: 70a541bd76cfb45d7c97ad47d984e5ace9dbea98
Author: Abhijith Das <adas at redhat.com>
AuthorDate: Mon Dec 21 11:37:23 2009 -0600
Committer: Abhijith Das <adas at redhat.com>
CommitterDate: Mon Dec 21 11:37:23 2009 -0600
gfs2_convert: interrupted rgrp conversion does not 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