Whamcloud - gitweb
ChangeLog, pass2.c, problem.c, problem.h:
authorTheodore Ts'o <tytso@mit.edu>
Fri, 22 Oct 1999 15:11:42 +0000 (15:11 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 22 Oct 1999 15:11:42 +0000 (15:11 +0000)
  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
e2fsck/pass2.c
e2fsck/problem.c
e2fsck/problem.h

index 91a73fc..5dfcc1a 100644 (file)
@@ -1,3 +1,12 @@
+1999-10-22    <tytso@valinux.com>
+
+       * 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    <tytso@valinux.com>
 
        * e2fsck.8.in: Update man page to use a more standard format (bold
index 2eec914..f41cdfe 100644 (file)
@@ -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;
index 3a54926..718002f 100644 (file)
@@ -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 */
index ddbc717..80b35be 100644 (file)
@@ -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
  */