OSDN Git Service

ChangeLog, problem.c, problem.h, super.c:
authorTheodore Ts'o <tytso@mit.edu>
Mon, 8 May 2000 13:33:17 +0000 (13:33 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 8 May 2000 13:33:17 +0000 (13:33 +0000)
  problem.c, problem.h (PR_0_HURD_CLEAR_FILETYPE): Add new problem code.
  super.c (check_super_block): If the OS type in the superblock is the
   Hurd, check to see if the filetype feature is set, and offer to clear
   it if so.  This needs to be done since the Hurd doesn't properly
   support the filetype feature.  (And since the hurd allows the
   transmogrification of files to special files and vice versa --- for no
   good reason that I can understand --- it can't support the filetype
   feature for the forseeable future, either.)
ChangeLog, mke2fs.c:
  mke2fs.c (main): We forcibly turn off the filetype feature if the OS
   is the hurd, since the hurd doesn't support it.  (And since the hurd
   allows the transmogrification of files to special files and vice versa
   --- for no good reason that I can understand --- it can't support the
   filetype feature for the forseeable future, either.)
  mke2fs.c (proceed_question): Fix reversed sense of proceed_question
   that was busted due to the internationalization patch.  Fixed bug
   where if proceed_question was called twice, the input buffer wasn't
   cleared of the previous question's newline.
ChangeLog, expect.1, expect.2, image.gz, name:
  f_hurd: Add test for Hurd-specific features (right now, just checks to
   make sure the filetype feature is cleared)
ChangeLog, ls.c:
  ls.c (list_super): Change the string displayed for the Hurd to be
   GNU/Hurd, instead of just "GNU".

13 files changed:
e2fsck/ChangeLog
e2fsck/problem.c
e2fsck/problem.h
e2fsck/super.c
lib/e2p/ChangeLog
lib/e2p/ls.c
misc/ChangeLog
misc/mke2fs.c
tests/ChangeLog
tests/f_hurd/expect.1 [new file with mode: 0644]
tests/f_hurd/expect.2 [new file with mode: 0644]
tests/f_hurd/image.gz [new file with mode: 0644]
tests/f_hurd/name [new file with mode: 0644]

index 3cd1387..483eec7 100644 (file)
@@ -1,3 +1,17 @@
+2000-05-08  Theodore Ts'o  <tytso@valinux.com>
+
+       * problem.c, problem.h (PR_0_HURD_CLEAR_FILETYPE): Add new problem
+               code. 
+
+       * super.c (check_super_block): If the OS type in the superblock is
+               the Hurd, check to see if the filetype feature is set, and
+               offer to clear it if so.   This needs to be done since the
+               Hurd doesn't properly support the filetype feature.
+               (And since the hurd allows the transmogrification of files
+               to special files and vice versa --- for no good reason
+               that I can understand --- it can't support the filetype
+               feature for the forseeable future, either.)
+
 2000-04-03  Theodore Ts'o  <tytso@valinux.com>
 
        * unix.c: For platforms that don't define optarg.h, manually
index 42ceb53..ebbef2d 100644 (file)
@@ -167,9 +167,13 @@ static const struct e2fsck_problem problem_table[] = {
 
        /* Inode count in superblock is incorrect */
        { PR_0_INODE_COUNT_WRONG,
-         N_("@i count in @S is %i, should be %j\n"),
+         N_("@i count in @S is %i, should be %j.\n"),
          PROMPT_FIX, 0 },
-                 
+
+       { PR_0_HURD_CLEAR_FILETYPE,
+         N_("The Hurd does not support the filetype feature.\n"),
+         PROMPT_CLEAR, 0 },      
+
        /* Pass 1 errors */
        
        /* Pass 1: Checking inodes, blocks, and sizes */
index 1de1dc9..3c9586d 100644 (file)
@@ -91,6 +91,9 @@ struct problem_context {
 /* Inode count in the superblock incorrect */
 #define PR_0_INODE_COUNT_WRONG 0x00000D
 
+/* The Hurd does not support the filetype feature */
+#define PR_0_HURD_CLEAR_FILETYPE 0x00000E
+       
 /*
  * Pass 1 errors
  */
index 962dd81..5f15cee 100644 (file)
@@ -205,18 +205,33 @@ void check_super_block(e2fsck_t ctx)
                ext2fs_mark_super_dirty(fs);
        }
 
+       clear_problem_context(&pctx);
+       
 #ifndef EXT2_SKIP_UUID
        /*
         * If the UUID field isn't assigned, assign it.
         */
        if (!(ctx->options & E2F_OPT_READONLY) && uuid_is_null(s->s_uuid)) {
-               clear_problem_context(&pctx);
                if (fix_problem(ctx, PR_0_ADD_UUID, &pctx)) {
                        uuid_generate(s->s_uuid);
                        ext2fs_mark_super_dirty(fs);
                }
        }
 #endif
+       
+       /*
+        * For the Hurd, check to see if the filetype option is set,
+        * since it doesn't support it.
+        */
+       if (fs->super->s_creator_os == EXT2_OS_HURD &&
+           (fs->super->s_feature_incompat &
+            EXT2_FEATURE_INCOMPAT_FILETYPE)) {
+               if (fix_problem(ctx, PR_0_HURD_CLEAR_FILETYPE, &pctx)) {
+                       fs->super->s_feature_incompat &=
+                               ~EXT2_FEATURE_INCOMPAT_FILETYPE;
+                       ext2fs_mark_super_dirty(fs);
+
+               }
+       }
        return;
 }
-
index 5293aae..e54b9a7 100644 (file)
@@ -1,3 +1,8 @@
+2000-05-08  Theodore Ts'o  <tytso@valinux.com>
+
+       * ls.c (list_super): Change the string displayed for the Hurd to
+               be GNU/Hurd, instead of just "GNU".
+
 Thu Apr  6 17:38:00 2000  Theodore Y. Ts'o  <tytso@signal.thunk.org>
 
        * feature.c: Make feature_list static; it shouldn't be exported.
index 5544e25..2fb86df 100644 (file)
@@ -230,7 +230,7 @@ void list_super (struct ext2_super_block * s)
        printf ("\n");
        switch (s->s_creator_os) {
            case EXT2_OS_LINUX: os = "Linux"; break;
-           case EXT2_OS_HURD:  os = "GNU"; break;
+           case EXT2_OS_HURD:  os = "GNU/Hurd"; break;
            case EXT2_OS_MASIX: os = "Masix"; break;
            default:            os = "unknown"; break;
        }
index 37ee1f9..2debf22 100644 (file)
@@ -1,3 +1,18 @@
+2000-05-08  Theodore Ts'o  <tytso@valinux.com>
+
+       * mke2fs.c (main): We forcibly turn off the filetype feature if
+               the OS is the hurd, since the hurd doesn't support it.
+               (And since the hurd allows the transmogrification of files
+               to special files and vice versa --- for no good reason
+               that I can understand --- it can't support the filetype
+               feature for the forseeable future, either.)
+
+       * mke2fs.c (proceed_question): Fix reversed sense of
+               proceed_question that was busted due to the
+               internationalization patch.  Fixed bug where if
+               proceed_question was called twice, the input buffer wasn't
+               cleared of the previous question's newline.
+       
 Thu Apr  6 17:50:25 2000  Theodore Y. Ts'o  <tytso@signal.thunk.org>
 
        * badblocks.c (flush_bufs): Use fsync() if the system doesn't
index 9b9bd31..3026f4c 100644 (file)
@@ -125,14 +125,15 @@ static int int_log10(unsigned int arg)
 
 static void proceed_question(NOARGS)
 {
-       int c;
+       char buf[256];
        char *short_yes = _("yY");
 
        fflush(stdout);
        fflush(stderr);
        printf(_("Proceed anyway? (y,n) "));
-       c = getchar();
-       if (strchr(short_yes, (char) c))
+       buf[0] = 0;
+       fgets(buf, sizeof(buf), stdin);
+       if (strchr(short_yes, buf[0]) == 0)
                exit(1);
 }
 
@@ -1034,6 +1035,14 @@ int main (int argc, char *argv[])
        }
 
        /*
+        * For the Hurd, we will turn off filetype since it doesn't
+        * support it.
+        */
+       if (fs->super->s_creator_os == EXT2_OS_HURD)
+               fs->super->s_feature_incompat &=
+                       ~EXT2_FEATURE_INCOMPAT_FILETYPE;
+
+       /*
         * Set the volume label...
         */
        if (volume_label) {
index f001f0b..474cae8 100644 (file)
@@ -1,3 +1,8 @@
+2000-05-08  Theodore Ts'o  <tytso@valinux.com>
+
+       * f_hurd: Add test for Hurd-specific features (right now, just
+               checks to make sure the filetype feature is cleared)
+
 2000-04-06  Theodore Ts'o  <tytso@valinux.com>
 
        * f_filetype: Updated expect script to match with new text for
diff --git a/tests/f_hurd/expect.1 b/tests/f_hurd/expect.1
new file mode 100644 (file)
index 0000000..f7bfc56
--- /dev/null
@@ -0,0 +1,12 @@
+The Hurd does not support the filetype feature.
+Clear? yes
+
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 11/16 files (0.0% non-contiguous), 20/100 blocks
+Exit status is 1
diff --git a/tests/f_hurd/expect.2 b/tests/f_hurd/expect.2
new file mode 100644 (file)
index 0000000..44bff62
--- /dev/null
@@ -0,0 +1,7 @@
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+test_filesys: 11/16 files (0.0% non-contiguous), 20/100 blocks
+Exit status is 0
diff --git a/tests/f_hurd/image.gz b/tests/f_hurd/image.gz
new file mode 100644 (file)
index 0000000..58ffe0c
Binary files /dev/null and b/tests/f_hurd/image.gz differ
diff --git a/tests/f_hurd/name b/tests/f_hurd/name
new file mode 100644 (file)
index 0000000..a692986
--- /dev/null
@@ -0,0 +1 @@
+GNU/Hurd specific tests