[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/gfs/gfs_fsck rgrp.c



CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL4
Changes by:	rpeterso sourceware org	2007-05-04 13:43:30

Modified files:
	gfs/gfs_fsck   : rgrp.c 

Log message:
	Resolves: bz 238719: GFS fsck is has problems with resource groups

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs/gfs_fsck/rgrp.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.3.2.5&r2=1.3.2.6

--- cluster/gfs/gfs_fsck/rgrp.c	2006/04/20 20:43:41	1.3.2.5
+++ cluster/gfs/gfs_fsck/rgrp.c	2007/05/04 13:43:30	1.3.2.6
@@ -179,12 +179,27 @@
 			if (repair_if_corrupted) {
 				if (query(sdp, "Fix the RG? (y/n)")) {
 					log_err("Attempting to repair the RG.\n");
-					memset(&rgd->rd_rg, 0, sizeof(struct gfs_rgrp));
-					rgd->rd_rg.rg_header.mh_magic = GFS_MAGIC;
-					rgd->rd_rg.rg_header.mh_type = GFS_METATYPE_RG;
-					rgd->rd_rg.rg_header.mh_format = GFS_FORMAT_RG;
-					rgd->rd_rg.rg_free = rgd->rd_ri.ri_data;
-					gfs_rgrp_out(&rgd->rd_rg, BH_DATA(rgd->rd_bh[x]));
+					if (x) {
+						struct gfs_meta_header mh;
+
+						memset(&mh, 0, sizeof(mh));
+						mh.mh_magic = GFS_MAGIC;
+						mh.mh_type = GFS_METATYPE_RB;
+						mh.mh_format = GFS_FORMAT_RB;
+						gfs_meta_header_out(&mh,
+								    BH_DATA(rgd->rd_bh[x]));
+					} else {
+						memset(&rgd->rd_rg, 0,
+						       sizeof(struct gfs_rgrp));
+						rgd->rd_rg.rg_header.mh_magic = GFS_MAGIC;
+						rgd->rd_rg.rg_header.mh_type =
+							GFS_METATYPE_RG;
+						rgd->rd_rg.rg_header.mh_format =
+							GFS_FORMAT_RG;
+						rgd->rd_rg.rg_free = rgd->rd_ri.ri_data;
+						gfs_rgrp_out(&rgd->rd_rg,
+							     BH_DATA(rgd->rd_bh[x]));
+					}
 					write_buf(sdp, rgd->rd_bh[x], BW_WAIT);
 				}
 			}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]