From: Theodore Ts'o Date: Mon, 2 Sep 2019 21:44:14 +0000 (-0400) Subject: e2fsck: make the low dtime check consistent when using the backup superblock X-Git-Tag: archive/debian/1.45.4-1~1^2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=576fada197763b3f60b37c265549bb19c7eebeb1;hp=82d6fa9ea79e44e43f4febb56058250bb30d8c6e;p=thirdparty%2Fe2fsprogs.git e2fsck: make the low dtime check consistent when using the backup superblock The backup superblock may have a last mounted time of zero, if it has never been updated since the file system was created. In that case, the low dtime check may get disabled when using the backup superblock, even though subsequent e2fsck runs will end up using the low dtime check. This can cause a failure of ext4/007, since since when e2fsck is run a second time after the file system is mounted, the low dtime check will trigger the e2fsck complaint: Inode NNNN was part of the orphaned inode list. IGNORED. Signed-off-by: Theodore Ts'o --- diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 524577ae9..2b5bfa329 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -1340,8 +1340,10 @@ void e2fsck_pass1(e2fsck_t ctx) if (ctx->progress && ((ctx->progress)(ctx, 1, 0, ctx->fs->group_desc_count))) goto endit; - if ((fs->super->s_wtime < fs->super->s_inodes_count) || - (fs->super->s_mtime < fs->super->s_inodes_count) || + if ((fs->super->s_wtime && + fs->super->s_wtime < fs->super->s_inodes_count) || + (fs->super->s_mtime && + fs->super->s_mtime < fs->super->s_inodes_count) || (fs->super->s_mkfs_time && fs->super->s_mkfs_time < fs->super->s_inodes_count)) low_dtime_check = 0; diff --git a/tests/f_no/expect b/tests/f_no/expect index e7b619d53..140a01ff1 100644 --- a/tests/f_no/expect +++ b/tests/f_no/expect @@ -12,6 +12,8 @@ Clear? no Inode 13 has an invalid extent (logical block 0, invalid physical block 888888888888, len 1) Clear? no +Inodes that were part of a corrupted orphan linked list found. Fix? no +Inode 14 was part of the orphaned inode list. IGNORED. Inode 14 is in use, but has dtime set. Fix? no Inode 14 has an invalid extent (logical block 300, invalid physical block 777777777777, len 300) diff --git a/tests/f_yes/expect b/tests/f_yes/expect index c73e62043..93b04ef1b 100644 --- a/tests/f_yes/expect +++ b/tests/f_yes/expect @@ -12,7 +12,8 @@ Clear? yes Inode 13 has an invalid extent (logical block 0, invalid physical block 888888888888, len 1) Clear? yes -Inode 14 is in use, but has dtime set. Fix? yes +Inodes that were part of a corrupted orphan linked list found. Fix? yes +Inode 14 was part of the orphaned inode list. FIXED. Inode 14 has an invalid extent (logical block 300, invalid physical block 777777777777, len 300) Clear? yes diff --git a/tests/f_yesall/expect b/tests/f_yesall/expect index f6d3c2b8f..757b04818 100644 --- a/tests/f_yesall/expect +++ b/tests/f_yesall/expect @@ -16,8 +16,9 @@ Inode 13 has an invalid extent (logical block 0, invalid physical block 888888888888, len 1) Clear? yes -Inode 14 is in use, but has dtime set. Fix? yes +Inodes that were part of a corrupted orphan linked list found. Fix? yes +Inode 14 was part of the orphaned inode list. FIXED. Inode 14 has an invalid extent (logical block 300, invalid physical block 777777777777, len 300) Clear? yes diff --git a/tests/f_yesthenall/expect b/tests/f_yesthenall/expect index 1fc3bde63..73f35a34d 100644 --- a/tests/f_yesthenall/expect +++ b/tests/f_yesthenall/expect @@ -12,7 +12,8 @@ Clear? yes Inode 13 has an invalid extent (logical block 0, invalid physical block 888888888888, len 1) Clear? yes -Inode 14 is in use, but has dtime set. Fix? yes +Inodes that were part of a corrupted orphan linked list found. Fix? yes +Inode 14 was part of the orphaned inode list. FIXED. Inode 14 has an invalid extent (logical block 300, invalid physical block 777777777777, len 300) Clear? yes diff --git a/tests/f_yesthenno/expect b/tests/f_yesthenno/expect index de55f47d3..94bcc6a8f 100644 --- a/tests/f_yesthenno/expect +++ b/tests/f_yesthenno/expect @@ -12,7 +12,8 @@ Clear? yes Inode 13 has an invalid extent (logical block 0, invalid physical block 888888888888, len 1) Clear? yes -Inode 14 is in use, but has dtime set. Fix? yes +Inodes that were part of a corrupted orphan linked list found. Fix? yes +Inode 14 was part of the orphaned inode list. FIXED. Inode 14 has an invalid extent (logical block 300, invalid physical block 777777777777, len 300) Clear? yes