[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
Branch: 	RHEL5
Changes by:	rpeterso sourceware org	2007-01-23 19:54:23

Modified files:
	gfs2/fsck      : metawalk.c 

Log message:
	Resolves: bz 223843 GFS2: gfs2_fsck segfaulting on corrupt extended
	attributes

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/fsck/metawalk.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.3.2.3&r2=1.3.2.4

--- cluster/gfs2/fsck/metawalk.c	2006/11/20 15:44:53	1.3.2.3
+++ cluster/gfs2/fsck/metawalk.c	2007/01/23 19:54:23	1.3.2.4
@@ -227,7 +227,7 @@
 				 * compare it against leaf->lf_entries */
 				break;
 			} else {
-				brelse(lbh, *updated);
+				brelse(lbh, *update);
 				if(!leaf.lf_next)
 					break;
 				leaf_no = leaf.lf_next;
@@ -247,6 +247,7 @@
 	uint64_t *ea_data_ptr = NULL;
 	int i;
 	int error = 0;
+	uint32_t offset = (uint32_t)sizeof(struct gfs2_meta_header);
 
 	if(!pass->check_eattr_entry) {
 		return 0;
@@ -287,11 +288,11 @@
 				}
 			}
 		}
-		if(ea_hdr->ea_flags & GFS2_EAFLAG_LAST){
-			/* FIXME: better equal the end of the block */
+		offset += be32_to_cpu(ea_hdr->ea_rec_len);
+		if(ea_hdr->ea_flags & GFS2_EAFLAG_LAST ||
+		   offset >= ip->i_sbd->sd_sb.sb_bsize || ea_hdr->ea_rec_len == 0){
 			break;
 		}
-		/* FIXME: be sure this doesn't go beyond the end */
 		ea_hdr_prev = ea_hdr;
 		ea_hdr = (struct gfs2_ea_header *)
 			((char *)(ea_hdr) +


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