PERFORCE change 20972 for review

Brian Feldman green at freebsd.org
Mon Nov 11 20:04:23 GMT 2002


http://perforce.freebsd.org/chv.cgi?CH=20972

Change 20972 by green at green_laptop_2 on 2002/11/11 12:04:14

	Fix extattr corruption on the disk instead of just noticing
	it.

Affected files ...

.. //depot/projects/trustedbsd/mac/sbin/fsck_ffs/ea.c#3 edit

Differences ...

==== //depot/projects/trustedbsd/mac/sbin/fsck_ffs/ea.c#3 (text+ko) ====

@@ -63,10 +63,14 @@
 eascan(struct inodesc *idesc, struct ufs2_dinode *dp)
 {
 	struct bufarea *bp;
-	char tmpf[sizeof("/tmp/fsck_ffs-extent.XXXXXX")];
 	u_char *cp;
 	long blksiz;
+#if 0
+	char tmpf[sizeof("/tmp/fsck_ffs-extent.XXXXXX")];
 	int fd;
+#else
+	union dinode *fixdp;
+#endif
 
 	if (dp->di_extsize == 0)
 		return 0;
@@ -79,6 +83,7 @@
 	if (chkextattr(cp, dp->di_extsize)) {
 		pfatal("CORRUPT EXTENDED ATTRIBUTES I=%lu",
 		    (u_long)idesc->id_number);
+#if 0
 		if (reply("DUMP EXTENT") == 1) {
 			strcpy(tmpf, "/tmp/fsck_ffs-extent.XXXXXX");
 			fd = mkstemp(tmpf);
@@ -91,6 +96,14 @@
 				(void)close(fd);
 			}
 		}
+#else
+		if (reply("CLEAR") == 1) {
+			fixdp = ginode(idesc->id_number);
+			fixdp->dp2.di_extsize = 0;
+			bzero(&fixdp->dp2.di_extb, sizeof(fixdp->dp2.di_extb));
+			inodirty();
+		}
+#endif
 	}
 	bp->b_flags &= ~B_INUSE;
 	return (0);
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list