From d1070d91b4de8438dc78c034283baaa19b31d25e Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 28 Aug 2008 23:09:35 -0400 Subject: [PATCH] tune2fs, mke2fs: Change default directory hash algorithm to half_md4 The half_md4 algorithm is faster and more collision resistant. Let's switch to it as the default. Signed-off-by: "Theodore Ts'o" --- misc/mke2fs.c | 2 +- misc/tune2fs.c | 2 +- tests/m_dasd_bs/expect.1 | 2 +- tests/m_large_file/expect.1 | 2 +- tests/m_meta_bg/expect.1 | 2 +- tests/m_no_opt/expect.1 | 2 +- tests/m_raid_opt/expect.1 | 2 +- tests/m_std/expect.1 | 2 +- tests/m_uninit/expect.1 | 2 +- tests/r_move_itable/expect | 8 ++++---- tests/r_resize_inode/expect | 6 +++--- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/misc/mke2fs.c b/misc/mke2fs.c index c1850a4..70ff889 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -1880,7 +1880,7 @@ int main (int argc, char *argv[]) /* * Initialize the directory index variables */ - fs->super->s_def_hash_version = EXT2_HASH_TEA; + fs->super->s_def_hash_version = EXT2_HASH_HALF_MD4; uuid_generate((unsigned char *) fs->super->s_hash_seed); /* diff --git a/misc/tune2fs.c b/misc/tune2fs.c index a1fa57b..ab35a71 100644 --- a/misc/tune2fs.c +++ b/misc/tune2fs.c @@ -399,7 +399,7 @@ static void update_feature_set(ext2_filsys fs, char *features) if (FEATURE_ON(E2P_FEATURE_COMPAT, EXT2_FEATURE_COMPAT_DIR_INDEX)) { if (!sb->s_def_hash_version) - sb->s_def_hash_version = EXT2_HASH_TEA; + sb->s_def_hash_version = EXT2_HASH_HALF_MD4; if (uuid_is_null((unsigned char *) sb->s_hash_seed)) uuid_generate((unsigned char *) sb->s_hash_seed); } diff --git a/tests/m_dasd_bs/expect.1 b/tests/m_dasd_bs/expect.1 index 59fc457..9bc8a85 100644 --- a/tests/m_dasd_bs/expect.1 +++ b/tests/m_dasd_bs/expect.1 @@ -53,7 +53,7 @@ Reserved blocks uid: 0 Reserved blocks gid: 0 First inode: 11 Inode size: 128 -Default directory hash: tea +Default directory hash: half_md4 Group 0: (Blocks 0-16383) diff --git a/tests/m_large_file/expect.1 b/tests/m_large_file/expect.1 index ae27f02..abf2d99 100644 --- a/tests/m_large_file/expect.1 +++ b/tests/m_large_file/expect.1 @@ -53,7 +53,7 @@ First inode: 11 Inode size: 256 Required extra isize: 28 Desired extra isize: 28 -Default directory hash: tea +Default directory hash: half_md4 Group 0: (Blocks 0-16383) diff --git a/tests/m_meta_bg/expect.1 b/tests/m_meta_bg/expect.1 index 7401fd9..d44be8c 100644 --- a/tests/m_meta_bg/expect.1 +++ b/tests/m_meta_bg/expect.1 @@ -51,7 +51,7 @@ Reserved blocks uid: 0 Reserved blocks gid: 0 First inode: 11 Inode size: 128 -Default directory hash: tea +Default directory hash: half_md4 Group 0: (Blocks 1-1024) diff --git a/tests/m_no_opt/expect.1 b/tests/m_no_opt/expect.1 index a63358b..faa565d 100644 --- a/tests/m_no_opt/expect.1 +++ b/tests/m_no_opt/expect.1 @@ -51,7 +51,7 @@ Reserved blocks uid: 0 Reserved blocks gid: 0 First inode: 11 Inode size: 128 -Default directory hash: tea +Default directory hash: half_md4 Group 0: (Blocks 1-8192) diff --git a/tests/m_raid_opt/expect.1 b/tests/m_raid_opt/expect.1 index f3c14b6..181534d 100644 --- a/tests/m_raid_opt/expect.1 +++ b/tests/m_raid_opt/expect.1 @@ -54,7 +54,7 @@ Reserved blocks uid: 0 Reserved blocks gid: 0 First inode: 11 Inode size: 128 -Default directory hash: tea +Default directory hash: half_md4 Group 0: (Blocks 1-1024) diff --git a/tests/m_std/expect.1 b/tests/m_std/expect.1 index 9f5e66e..4483578 100644 --- a/tests/m_std/expect.1 +++ b/tests/m_std/expect.1 @@ -53,7 +53,7 @@ Reserved blocks uid: 0 Reserved blocks gid: 0 First inode: 11 Inode size: 128 -Default directory hash: tea +Default directory hash: half_md4 Group 0: (Blocks 1-8192) diff --git a/tests/m_uninit/expect.1 b/tests/m_uninit/expect.1 index 02649d8..549aced 100644 --- a/tests/m_uninit/expect.1 +++ b/tests/m_uninit/expect.1 @@ -53,7 +53,7 @@ Reserved blocks uid: 0 Reserved blocks gid: 0 First inode: 11 Inode size: 128 -Default directory hash: tea +Default directory hash: half_md4 Group 0: (Blocks 1-8192) [ITABLE_ZEROED] diff --git a/tests/r_move_itable/expect b/tests/r_move_itable/expect index 63fda32..0d08b16 100644 --- a/tests/r_move_itable/expect +++ b/tests/r_move_itable/expect @@ -42,7 +42,7 @@ Reserved blocks uid: 0 Reserved blocks gid: 0 First inode: 11 Inode size: 128 -Default directory hash: tea +Default directory hash: half_md4 Group 0: (Blocks 1-256) @@ -343,7 +343,7 @@ Reserved blocks uid: 0 Reserved blocks gid: 0 First inode: 11 Inode size: 128 -Default directory hash: tea +Default directory hash: half_md4 Group 0: (Blocks 1-256) @@ -880,7 +880,7 @@ Reserved blocks uid: 0 Reserved blocks gid: 0 First inode: 11 Inode size: 128 -Default directory hash: tea +Default directory hash: half_md4 Group 0: (Blocks 1-256) @@ -1653,7 +1653,7 @@ Reserved blocks uid: 0 Reserved blocks gid: 0 First inode: 11 Inode size: 128 -Default directory hash: tea +Default directory hash: half_md4 Group 0: (Blocks 1-256) diff --git a/tests/r_resize_inode/expect b/tests/r_resize_inode/expect index 09ebeb0..f4bee0f 100644 --- a/tests/r_resize_inode/expect +++ b/tests/r_resize_inode/expect @@ -40,7 +40,7 @@ Reserved blocks uid: 0 Reserved blocks gid: 0 First inode: 11 Inode size: 128 -Default directory hash: tea +Default directory hash: half_md4 Group 0: (Blocks 1-1024) @@ -488,7 +488,7 @@ Reserved blocks uid: 0 Reserved blocks gid: 0 First inode: 11 Inode size: 128 -Default directory hash: tea +Default directory hash: half_md4 Group 0: (Blocks 1-1024) @@ -645,7 +645,7 @@ Reserved blocks uid: 0 Reserved blocks gid: 0 First inode: 11 Inode size: 128 -Default directory hash: tea +Default directory hash: half_md4 Group 0: (Blocks 1-1024) -- 1.8.3.1