From 9cbfb8d0d97f6c5400f94d86bcbedb094f970072 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Tue, 4 Jul 2000 19:51:22 +0000 Subject: [PATCH] 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. --- e2fsck/ChangeLog | 7 +++++++ e2fsck/pass1.c | 14 ++++++++++++++ 2 files changed, 21 insertions(+) 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 + + * 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 * 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 @@ void e2fsck_pass1(e2fsck_t ctx) 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"); -- 1.8.3.1