From 7847c1d4fff9195c16b6d74194d104200b3f6c67 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 22 Oct 1999 15:11:42 +0000 Subject: [PATCH] ChangeLog, pass2.c, problem.c, problem.h: pass2.c (check_filetype): If the filetype filesystem feature is not set, and a directory entry has a dirent feature, offer to clear it (since 2.0 kernels will do complain will interpret it as a very large name length field). --- e2fsck/ChangeLog | 9 +++++++++ e2fsck/pass2.c | 9 +++++++-- e2fsck/problem.c | 5 +++++ e2fsck/problem.h | 3 +++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 91a73fc..5dfcc1a 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,12 @@ +1999-10-22 + + * pass2.c (check_filetype): If the filetype filesystem feature is + not set, and a directory entry has a dirent feature, offer + to clear it (since 2.0 kernels will do complain will + interpret it as a very large name length field). + + * problem.c (PR_2_CLEAR_FILETYPE): Add new problem code. + 1999-10-21 * e2fsck.8.in: Update man page to use a more standard format (bold diff --git a/e2fsck/pass2.c b/e2fsck/pass2.c index 2eec914..f41cdfe 100644 --- a/e2fsck/pass2.c +++ b/e2fsck/pass2.c @@ -291,8 +291,13 @@ static _INLINE_ int check_filetype(e2fsck_t ctx, struct ext2_inode inode; if (!(ctx->fs->super->s_feature_incompat & - EXT2_FEATURE_INCOMPAT_FILETYPE)) - return 0; + EXT2_FEATURE_INCOMPAT_FILETYPE)) { + if (filetype == 0 || + !fix_problem(ctx, PR_2_CLEAR_FILETYPE, pctx)) + return 0; + dirent->name_len = dirent->name_len & 0xFF; + return 1; + } if (ext2fs_test_inode_bitmap(ctx->inode_dir_map, dirent->inode)) { should_be = EXT2_FT_DIR; diff --git a/e2fsck/problem.c b/e2fsck/problem.c index 3a54926..718002f 100644 --- a/e2fsck/problem.c +++ b/e2fsck/problem.c @@ -703,6 +703,11 @@ static const struct e2fsck_problem problem_table[] = { "@E has an incorrect filetype (was %dt, should be %N)\n", PROMPT_FIX, 0 }, + /* Directory filetype set on filesystem */ + { PR_2_CLEAR_FILETYPE, + "@E has filetype set\n", + PROMPT_CLEAR, PR_PREEN_OK }, + /* Pass 3 errors */ /* Pass 3: Checking directory connectivity */ diff --git a/e2fsck/problem.h b/e2fsck/problem.h index ddbc717..80b35be 100644 --- a/e2fsck/problem.h +++ b/e2fsck/problem.h @@ -417,6 +417,9 @@ struct problem_context { /* Directory filetype incorrect */ #define PR_2_BAD_FILETYPE 0x020028 +/* Directory filetype set when it shouldn't be */ +#define PR_2_CLEAR_FILETYPE 0x020029 + /* * Pass 3 errors */ -- 1.8.3.1