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

[Cluster-devel] cluster/gfs2/fsck metawalk.c



CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	rpeterso sourceware org	2006-11-14 22:51:35

Modified files:
	gfs2/fsck      : metawalk.c 

Log message:
	Resolves: bz211465
	fsck errors on gfs2 volume

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/fsck/metawalk.c.diff?cvsroot=cluster&r1=1.3&r2=1.4

--- cluster/gfs2/fsck/metawalk.c	2006/06/12 20:41:43	1.3
+++ cluster/gfs2/fsck/metawalk.c	2006/11/14 22:51:35	1.4
@@ -74,15 +74,26 @@
 				return 1;
 			}
 		} else {
-			error = pass->check_dentry(ip, dent, prev, bh, filename, update,
-									   count, pass->private);
-			if(error < 0) {
-				stack;
-				return -1;
+			if (!de.de_inum.no_addr && first) { /* reverse sentinel */
+				log_debug("First dirent is a Sentinel (place holder).\n");
+				/* Swap the two to silently make it a proper sentinel */
+				de.de_inum.no_addr = de.de_inum.no_formal_ino;
+				de.de_inum.no_formal_ino = 0;
+				gfs2_dirent_out(&de, (char *)dent);
+				*update = 1; /* Mark dirent buffer as modified */
+				first = 0;
+			}
+			else {
+				error = pass->check_dentry(ip, dent, prev, bh, filename,
+							   update, count, pass->private);
+				if(error < 0) {
+					stack;
+					return -1;
+				}
+				/*if(error > 0) {
+				  return 1;
+				  }*/
 			}
-			/*if(error > 0) {
-			  return 1;
-			  }*/
 		}
 
 		if ((char *)dent + de.de_rec_len >= bh_end){
@@ -165,7 +176,7 @@
 				/* Since the buffer possibly got
 				   updated directly, release it now,
 				   and grab it again later if we need it */
-				brelse(lbh, not_updated);
+				brelse(lbh, *update);
 				if(error < 0) {
 					stack;
 					return -1;


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