gfs2-utils: master - gfs2_convert: gfs2_convert doesn't resume after interrupted conversion

Abhijith Das adas at fedoraproject.org
Mon Sep 27 18:42:46 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=cc703e11a2fd3c8adf09d13742b5cfa76f3091d3
Commit:        cc703e11a2fd3c8adf09d13742b5cfa76f3091d3
Parent:        afabf7e6c8547e9651ee8a168e5dc65675c76d8e
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:39:11 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 659cd4a..2cde2a8 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -150,6 +150,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.                                       */
@@ -1140,7 +1141,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 */
@@ -1611,6 +1614,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