Skip to contentSkip to conversation

Cluster Project branch, STABLE2, updated. cluster-2.02.00-62-g819fddb

Cluster-devel [email protected] 1 participant 1 message Apr 11, 2008

lore
Share & tools
lore
#0 lore raw

This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Cluster Project".

http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=819fddbffaf73550a046f79e78d5147f0e8b9030

The branch, STABLE2 has been updated

       via  819fddbffaf73550a046f79e78d5147f0e8b9030 (commit)
       via  acf6100f3e0f2eefe73019d5a1b2d18cd59ea093 (commit)
       via  755a9a68e99b29856aef856df8ab5a1af46b65ed (commit)
       via  40cd555c21891563f67411175854a00fbb704b25 (commit)
      from  a3ff336f79cabcb020c750cb569de0872bf3e05d (commit)

Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.

- Log ----------------------------------------------------------------- commit 819fddbffaf73550a046f79e78d5147f0e8b9030

Author: Bob Peterson <[email protected]>
Date:   Thu Apr 10 10:45:47 2008 -0500

Fix some compiler warnings in gfs2_edit

commit acf6100f3e0f2eefe73019d5a1b2d18cd59ea093

Author: Bob Peterson <[email protected]>
Date:   Thu Apr 10 10:45:47 2008 -0500

gfs2_edit was not recalculating the max block size after it figured that out.

commit 755a9a68e99b29856aef856df8ab5a1af46b65ed

Author: Bob Peterson <[email protected]>
Date:   Tue Mar 18 15:44:24 2008 -0500

Fix gfs2_edit print options (-p) to work properly for gfs-1 rgs and rindex. Also fixed rgflags option for gfs1.

commit 40cd555c21891563f67411175854a00fbb704b25

Author: Bob Peterson <[email protected]>
Date:   Tue Mar 11 18:18:43 2008 -0500

Fix savemeta so it saves gfs-1 rg information properly Also add savergs option to facilitate rg-only repairs.

-----------------------------------------------------------------------

Summary of changes:

 gfs2/edit/gfs2hex.c  |   12 ++--
 gfs2/edit/hexedit.c  |  178 +++++++++++++++++++++++++++++++++++++++++---------
 gfs2/edit/hexedit.h  |   32 +++++++++
 gfs2/edit/savemeta.c |   38 +++++++----
 4 files changed, 210 insertions(+), 50 deletions(-)
gfs2/edit/gfs2hex.c +6 -6
index dfd6c03..7262d78 100644
@@ -70,9 +70,9 @@ void print_gfs2(const char *fmt, ...)
 	va_start(args, fmt);
 	vsprintf(string, fmt, args);
 	if (termlines)
-		printw(string);
+		printw("%s", string);
 	else
-		printf(string);
+		printf("%s", string);
 	va_end(args);
 }
 
@@ -127,9 +127,9 @@ void print_it(const char *label, const char *fmt, const char *fmt2, ...)
 		vsprintf(tmp_string, fmt, args);
 
 		if (termlines)
-			printw(tmp_string);
+			printw("%s", tmp_string);
 		else
-			printf(tmp_string);
+			printf("%s", tmp_string);
 		check_highlight(FALSE);
 
 		if (fmt2) {
@@ -159,10 +159,10 @@ void print_it(const char *label, const char *fmt, const char *fmt2, ...)
 				fmtstring="(decimal)";
 			if (termlines) {
 				move(line, 50);
-				printw(fmtstring);
+				printw("%s", fmtstring);
 			}
 			else
-				printf(fmtstring);
+				printf("%s", fmtstring);
 		}
 		if (termlines) {
 			refresh();
gfs2/edit/hexedit.c +147 -31

313 lines not on this page · raw message

gfs2/edit/hexedit.h +32 -0
index 4778ab1..40cf47c 100644
@@ -135,6 +135,38 @@ struct gfs_log_header {
 	char lh_reserved[64];
 };
 
+struct gfs_rindex {
+	uint64_t ri_addr;     /* block # of 1st block (header) in rgrp */
+	uint32_t ri_length;   /* # fs blocks containing rgrp header & bitmap */
+	uint32_t ri_pad;
+
+	uint64_t ri_data1;    /* block # of first data/meta block in rgrp */
+	uint32_t ri_data;     /* number (qty) of data/meta blocks in rgrp */
+
+	uint32_t ri_bitbytes; /* total # bytes used by block alloc bitmap */
+
+	char ri_reserved[64];
+};
+
+struct gfs_rgrp {
+	struct gfs2_meta_header rg_header;
+
+	uint32_t rg_flags;      /* ?? */
+
+	uint32_t rg_free;       /* Number (qty) of free data blocks */
+
+	/* Dinodes are USEDMETA, but are handled separately from other METAs */
+	uint32_t rg_useddi;     /* Number (qty) of dinodes (used or free) */
+	uint32_t rg_freedi;     /* Number (qty) of unused (free) dinodes */
+	struct gfs2_inum rg_freedi_list; /* 1st block in chain of free dinodes */
+
+	/* These META statistics do not include dinodes (used or free) */
+	uint32_t rg_usedmeta;   /* Number (qty) of used metadata blocks */
+	uint32_t rg_freemeta;   /* Number (qty) of unused metadata blocks */
+
+	char rg_reserved[64];
+};
+
 EXTERN int block_is_jindex(void);
 EXTERN int block_is_rindex(void);
 EXTERN int block_is_inum_file(void);
gfs2/edit/savemeta.c +25 -13
index c73dc09..d582304 100644
@@ -631,7 +631,7 @@ void save_inode_data(int out_fd)
 	/* Process directory exhash inodes */
 	if (S_ISDIR(inode->i_di.di_mode)) {
 		if (inode->i_di.di_flags & GFS2_DIF_EXHASH) {
-			save_indirect_blocks(out_fd, cur_list, mybh,
+			save_indirect_blocks(out_fd, cur_list, metabh,
 					     height, 0);
 		}
 	}
@@ -701,7 +701,9 @@ void get_journal_inode_blocks(void)
 			struct gfs_jindex ji;
 			char jbuf[sizeof(struct gfs_jindex)];
 
+			bh = bread(&sbd, sbd1->sb_jindex_di.no_addr);
 			j_inode = inode_get(&sbd, bh);
+			brelse(bh, not_updated);
 			amt = gfs2_readi(j_inode, (void *)&jbuf,
 					 journal * sizeof(struct gfs_jindex),
 					 sizeof(struct gfs_jindex));
@@ -709,7 +711,6 @@ void get_journal_inode_blocks(void)
 				break;
 			gfs_jindex_in(&ji, jbuf);
 			jblock = ji.ji_addr;
-			inode_put(j_inode, not_updated);
 		} else {
 			if (journal > indirect->ii[0].dirents - 3)
 				break;
@@ -723,15 +724,17 @@ void get_journal_inode_blocks(void)
 	}
 }
 
-void savemeta(const char *out_fn, int slow)
+void savemeta(const char *out_fn, int saveoption)
 {
 	int out_fd;
+	int slow;
 	osi_list_t *tmp;
 	uint64_t memreq;
 	int rgcount;
 	uint64_t jindex_block;
 	struct gfs2_buffer_head *bh;
 
+	slow = (saveoption == 1);
 	sbd.md.journals = 1;
 
 	if (!out_fn)
@@ -760,7 +763,7 @@ void savemeta(const char *out_fn, int slow)
 			osi_list_init(&sbd.buf_hash[i]);
 		sbd.sd_sb.sb_bsize = GFS2_DEFAULT_BSIZE;
 		compute_constants(&sbd);
-		if(read_sb(&sbd) < 0)
+		if(!gfs1 && read_sb(&sbd) < 0)
 			slow = TRUE;
 		else
 			bufsize = sbd.bsize = sbd.sd_sb.sb_bsize;
@@ -808,6 +811,13 @@ void savemeta(const char *out_fn, int slow)
 	if (!slow) {
 		/* Save off the superblock */
 		save_block(sbd.device_fd, out_fd, 0x10 * (4096 / bufsize));
+		/* If this is gfs1, save off the rindex because it's not
+		   part of the file system as it is in gfs2. */
+		if (gfs1) {
+			block = sbd1->sb_rindex_di.no_addr;
+			save_block(sbd.device_fd, out_fd, block);
+			save_inode_data(out_fd);
+		}
 		/* Walk through the resource groups saving everything within */
 		for (tmp = sbd.rglist.next; tmp != &sbd.rglist;
 		     tmp = tmp->next){
@@ -834,15 +844,17 @@ void savemeta(const char *out_fn, int slow)
 				save_block(sbd.device_fd, out_fd, block);
 			}
 			/* Save off the other metadata: inodes, etc. */
-			while (!gfs2_next_rg_meta(rgd, &block, first)) {
-				int blktype;
-
-				warm_fuzzy_stuff(block, FALSE, TRUE);
-				blktype = save_block(sbd.device_fd, out_fd,
-						     block);
-				if (blktype == GFS2_METATYPE_DI)
-					save_inode_data(out_fd);
-				first = 0;
+			if (saveoption != 2) {
+				while (!gfs2_next_rg_meta(rgd, &block, first)) {
+					int blktype;
+
+					warm_fuzzy_stuff(block, FALSE, TRUE);
+					blktype = save_block(sbd.device_fd,
+							     out_fd, block);
+					if (blktype == GFS2_METATYPE_DI)
+						save_inode_data(out_fd);
+					first = 0;
+				}
 			}
 			gfs2_rgrp_relse(rgd, not_updated);
 		}

hooks/post-receive
--
Cluster Project