cluster: STABLE3 - gfs2_convert: gfs2_convert doesn't resume after interrupted conversion

Abhijith Das adas at fedoraproject.org
Mon Sep 27 18:38:50 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=cd0d5b10e6ad4f04c0fd0adb440d9ccf0380426f
Commit:        cd0d5b10e6ad4f04c0fd0adb440d9ccf0380426f
Parent:        5492f5160f1cef50ac5fc38cf184974e587bbfb3
Author:        Abhijith Das <adas at redhat.com>
AuthorDate:    Mon Sep 27 13:34:43 2010 -0500
Committer:     Abhijith Das <adas at redhat.com>
CommitterDate: Mon Sep 27 13:34:43 2010 -0500

gfs2_convert: gfs2_convert doesn't resume after interrupted conversion

This patch causes the inode conversion routine to skip over the jindex and
rindex inodes. Without this patch, the jindex and rindex inodes are converted
to gfs2 format and once converted, there's no way to go back to gfs1 for these
two inodes were the convert to be interrupted somehow. In the eyes of the
subsequent gfs2_convert run, these two inodes would be corrupt and gfs2_convert
would bail out of the conversion.
Skipping conversion of these two inodes doesn't affect gfs2_convert as these
two inodes are freed from disk towards the end of the conversion process. New
jindex and rindex inodes are created for gfs2 separately in the master
directory.

Note: This issue with reconversion failing occurs only when the jindex/rindex
inodes are unstuffed. When stuffed, gfs1 and gfs2 inodes have a similar
structure, so it doesn't matter if these inodes are converted or not, however
with inode height > 0 the structures of gfs1 and gfs2 differ.

Resolves: rhbz#637913
Signed-off-by: Abhi Das <adas at redhat.com>
---
 gfs2/convert/gfs2_convert.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 6a754b1..f84de84 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -148,6 +148,7 @@ uint64_t gfs2_heightsize[GFS2_MAX_META_HEIGHT];
 uint64_t gfs2_jheightsize[GFS2_MAX_META_HEIGHT];
 uint32_t gfs2_max_height;
 uint32_t gfs2_max_jheight;
+uint64_t jindex_addr = 0, rindex_addr = 0;
 
 /* ------------------------------------------------------------------------- */
 /* This function is for libgfs's sake.                                       */
@@ -1138,7 +1139,9 @@ static int inode_renumber(struct gfs2_sbd *sbp, uint64_t root_inode_addr, osi_li
 			}
 			bh = bread(sbp, block);
 			if (!gfs2_check_meta(bh, GFS_METATYPE_DI)) {/* if it is an dinode */
-				error = adjust_inode(sbp, bh);
+				/* Skip the rindex and jindex inodes for now. */
+				if (block != rindex_addr && block != jindex_addr)
+					error = adjust_inode(sbp, bh);
 			} else { /* It's metadata, but not an inode, so fix the bitmap. */
 				int blk, buf_offset;
 				int bitmap_byte; /* byte within the bitmap to fix */
@@ -1609,6 +1612,10 @@ static int init(struct gfs2_sbd *sbp)
 	memcpy(&raw_gfs1_ondisk_sb, (struct gfs1_sb *)bh->b_data,
 		   sizeof(struct gfs1_sb));
 	gfs2_sb_in(&sbp->sd_sb, bh);
+
+	jindex_addr = be64_to_cpu(raw_gfs1_ondisk_sb.sb_jindex_di.no_addr);
+	rindex_addr = be64_to_cpu(raw_gfs1_ondisk_sb.sb_rindex_di.no_addr);
+
 	sbp->bsize = sbp->sd_sb.sb_bsize;
 	sbp->sd_inptrs = (sbp->bsize - sizeof(struct gfs_indirect)) /
 		sizeof(uint64_t);


More information about the cluster-commits mailing list