ChangeLog, super.c:

super.c (check_super_block): If we have any of the compatibility flags
  	set, we need to have a revision 1 filesystem.  Most kernels will not
  	check the flags on a rev 0 filesystem and we may have corruption
  	issues because of the incompatible changes to the filesystem.  Patch
  	from Andreas Dilger.
This commit is contained in:
Theodore Ts'o 2000-12-13 18:11:44 +00:00
parent 060b5fbf80
commit 7b59f1efb1
2 changed files with 24 additions and 1 deletions

View File

@ -1,5 +1,12 @@
2000-12-13 Theodore Ts'o <tytso@valinux.com>
* super.c (check_super_block): If we have any of the compatibility
flags set, we need to have a revision 1 filesystem. Most
kernels will not check the flags on a rev 0 filesystem
and we may have corruption issues because of the
incompatible changes to the filesystem. Patch from Andreas
Dilger.
* problem.c, problem.h (PR_0_FS_REV_LEVEL, PR_1_FS_REV_LEVEL): Add
new problem codes.

View File

@ -473,12 +473,28 @@ void check_super_block(e2fsck_t ctx)
}
}
/*
* If we have any of the compatibility flags set, we need to have a
* revision 1 filesystem. Most kernels will not check the flags on
* a rev 0 filesystem and we may have corruption issues because of
* the incompatible changes to the filesystem.
*/
if (!(ctx->options & E2F_OPT_READONLY) &&
fs->super->s_rev_level == EXT2_GOOD_OLD_REV &&
(fs->super->s_feature_compat ||
fs->super->s_feature_ro_compat ||
fs->super->s_feature_incompat) &&
fix_problem(ctx, PR_0_FS_REV_LEVEL, &pctx)) {
ext2fs_update_fs_rev(fs);
ext2fs_mark_super_dirty(fs);
}
/*
* Clean up any orphan inodes, if present.
*/
if (!(ctx->options & E2F_OPT_READONLY) && release_orphan_inodes(ctx)) {
fs->super->s_state &= ~EXT2_VALID_FS;
ext2fs_mark_super_dirty(ctx->fs);
ext2fs_mark_super_dirty(fs);
}
return;