[Cluster-devel] cluster/gfs2/edit gfs2hex.c hexedit.c

rpeterso at sourceware.org rpeterso at sourceware.org
Mon Jun 12 20:43:34 UTC 2006


CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	rpeterso at sourceware.org	2006-06-12 20:43:33

Modified files:
	gfs2/edit      : gfs2hex.c hexedit.c 

Log message:
	Fixed a bug when printing stuffed directories.  For example,
	gfs2_edit -p masterdir was not working properly.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/edit/gfs2hex.c.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/edit/hexedit.c.diff?cvsroot=cluster&r1=1.3&r2=1.4

--- cluster/gfs2/edit/gfs2hex.c	2006/06/06 14:35:32	1.2
+++ cluster/gfs2/edit/gfs2hex.c	2006/06/12 20:43:33	1.3
@@ -220,12 +220,11 @@
 			 !(di->di_flags & GFS2_DIF_EXHASH)) {
 		int skip = 0;
 		/* Directory Entries: */
-		indirect[indirect_blocks].dirents = 0;
+		indirect[0].dirents = 0;
 		for (x = sizeof(struct gfs2_dinode); x < bufsize; x += skip) {
-			skip = indirect_dirent(&indirect[indirect_blocks], buf + x, 0);
+			skip = indirect_dirent(&indirect[0], buf + x, indirect[0].dirents);
 			if (skip <= 0)
 				break;
-			indirect_blocks++;
 		}
 	}
 	else if (isdir &&
--- cluster/gfs2/edit/hexedit.c	2006/06/06 14:35:32	1.3
+++ cluster/gfs2/edit/hexedit.c	2006/06/12 20:43:33	1.4
@@ -669,7 +669,11 @@
 					total_dirents++;
 					if (indirect[e].dirents > 1) {
 						eol(5);
-						print_gfs2("%d. (%d). 0x%llx: ", total_dirents, d + 1,
+						print_gfs2("%d. (%d). %lld (0x%llx) / %lld (0x%llx): ",
+								   total_dirents, d + 1,
+								   indirect[e].dirent[d].dirent.de_inum.no_formal_ino,
+								   indirect[e].dirent[d].dirent.de_inum.no_formal_ino,
+								   indirect[e].dirent[d].block,
 								   indirect[e].dirent[d].block);
 					}
 					switch(indirect[e].dirent[d].dirent.de_type) {




More information about the Cluster-devel mailing list