ChangeLog, pass1.c:
  pass1.c (e2fsck_pass1): Check to see if the ext3 s_last_orphan field
  	is set; if so, clear it, so that ext3 mounting code won't get confused
  	by the fact that we've cleared out the orphaned inodes.

diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog
index ebdb269..4bce316 100644
--- a/e2fsck/ChangeLog
+++ b/e2fsck/ChangeLog
@@ -1,3 +1,10 @@
+2000-07-04  Theodore Ts'o  <tytso@valinux.com>
+
+	* pass1.c (e2fsck_pass1): Check to see if the ext3 s_last_orphan
+		field is set; if so, clear it, so that ext3 mounting code
+		won't get confused by the fact that we've cleared out the
+		orphaned inodes.
+
 2000-06-10  Theodore Ts'o  <tytso@valinux.com>
 
 	* pass5.c (check_block_bitmaps, check_inode_bitmaps): Add error
diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index e4775d8..d780b96 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -283,6 +283,20 @@
 		return;
 	}
 
+	/*
+	 * If the last orphan field is set, clear it, since the pass1
+	 * processing will automatically find and clear the orphans.
+	 * In the future, we may want to try using the last_orphan
+	 * linked list ourselves, but for now, we clear it so that the
+	 * ext3 mount code won't get confused.
+	 */
+	if (!(ctx->options & E2F_OPT_READONLY)) {
+		if (fs->super->s_last_orphan) {
+			fs->super->s_last_orphan = 0;
+			ext2fs_mark_super_dirty(fs);
+		}
+	}
+
 	mark_table_blocks(ctx);
 	block_buf = (char *) e2fsck_allocate_memory(ctx, fs->blocksize * 3,
 						    "block interate buffer");