From 4ea0a1109d761e9caaa53f6fa9e036321826c5fa Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 8 May 2000 13:33:17 +0000 Subject: [PATCH] ChangeLog, problem.c, problem.h, super.c: 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". --- e2fsck/ChangeLog | 14 ++++++++++++++ e2fsck/problem.c | 8 ++++++-- e2fsck/problem.h | 3 +++ e2fsck/super.c | 19 +++++++++++++++++-- lib/e2p/ChangeLog | 5 +++++ lib/e2p/ls.c | 2 +- misc/ChangeLog | 15 +++++++++++++++ misc/mke2fs.c | 15 ++++++++++++--- tests/ChangeLog | 5 +++++ tests/f_hurd/expect.1 | 12 ++++++++++++ tests/f_hurd/expect.2 | 7 +++++++ tests/f_hurd/image.gz | Bin 0 -> 401 bytes tests/f_hurd/name | 1 + 13 files changed, 98 insertions(+), 8 deletions(-) create mode 100644 tests/f_hurd/expect.1 create mode 100644 tests/f_hurd/expect.2 create mode 100644 tests/f_hurd/image.gz create mode 100644 tests/f_hurd/name diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 3cd1387..483eec7 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,17 @@ +2000-05-08 Theodore Ts'o + + * 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 * unix.c: For platforms that don't define optarg.h, manually diff --git a/e2fsck/problem.c b/e2fsck/problem.c index 42ceb53..ebbef2d 100644 --- a/e2fsck/problem.c +++ b/e2fsck/problem.c @@ -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 */ diff --git a/e2fsck/problem.h b/e2fsck/problem.h index 1de1dc9..3c9586d 100644 --- a/e2fsck/problem.h +++ b/e2fsck/problem.h @@ -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 */ diff --git a/e2fsck/super.c b/e2fsck/super.c index 962dd81..5f15cee 100644 --- a/e2fsck/super.c +++ b/e2fsck/super.c @@ -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; } - diff --git a/lib/e2p/ChangeLog b/lib/e2p/ChangeLog index 5293aae..e54b9a7 100644 --- a/lib/e2p/ChangeLog +++ b/lib/e2p/ChangeLog @@ -1,3 +1,8 @@ +2000-05-08 Theodore Ts'o + + * 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 * feature.c: Make feature_list static; it shouldn't be exported. diff --git a/lib/e2p/ls.c b/lib/e2p/ls.c index 5544e25..2fb86df 100644 --- a/lib/e2p/ls.c +++ b/lib/e2p/ls.c @@ -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; } diff --git a/misc/ChangeLog b/misc/ChangeLog index 37ee1f9..2debf22 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,18 @@ +2000-05-08 Theodore Ts'o + + * 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 * badblocks.c (flush_bufs): Use fsync() if the system doesn't diff --git a/misc/mke2fs.c b/misc/mke2fs.c index 9b9bd31..3026f4c 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -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) { diff --git a/tests/ChangeLog b/tests/ChangeLog index f001f0b..474cae8 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,8 @@ +2000-05-08 Theodore Ts'o + + * 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 * 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 index 0000000..f7bfc56 --- /dev/null +++ b/tests/f_hurd/expect.1 @@ -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 index 0000000..44bff62 --- /dev/null +++ b/tests/f_hurd/expect.2 @@ -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 index 0000000000000000000000000000000000000000..58ffe0cefb93c6f91aa26fe39912f2bba893e22d GIT binary patch literal 401 zcmb2|=HNKHPt1~uIWspgJ(c0@4O?%gKnAu4i^Df=;s33`C3TBAbB&|ME$57^tclA` zEbL#pbmLO{%k%y#yhz{T;_d95;J&xZ)7e?1bUu5WZFnC?`|r5-I~5rsLwhrii6l$C ztj;Sr6lH()%ZGn?nc6K!H~hadzx=lCz3NxJ?Dtn6iCOx%=GV`(ze!)$?yIfXTm8A< zLd4E3pFaGaG~>{Q|3~BE8*^Ticpd(j&3a6jbOum6+2{N_(_IVjZdkNFq> a3;PBCQ5g)>1qZ_SGI!bfmoiLXWB>rZ%B=hV literal 0 HcmV?d00001 diff --git a/tests/f_hurd/name b/tests/f_hurd/name new file mode 100644 index 0000000..a692986 --- /dev/null +++ b/tests/f_hurd/name @@ -0,0 +1 @@ +GNU/Hurd specific tests -- 1.8.3.1