aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext3/namei.c')
-rw-r--r--fs/ext3/namei.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
index 8d6f965e502c..69a3d19ca9fd 100644
--- a/fs/ext3/namei.c
+++ b/fs/ext3/namei.c
@@ -364,6 +364,8 @@ dx_probe(struct qstr *entry, struct inode *dir,
364 goto fail; 364 goto fail;
365 } 365 }
366 hinfo->hash_version = root->info.hash_version; 366 hinfo->hash_version = root->info.hash_version;
367 if (hinfo->hash_version <= DX_HASH_TEA)
368 hinfo->hash_version += EXT3_SB(dir->i_sb)->s_hash_unsigned;
367 hinfo->seed = EXT3_SB(dir->i_sb)->s_hash_seed; 369 hinfo->seed = EXT3_SB(dir->i_sb)->s_hash_seed;
368 if (entry) 370 if (entry)
369 ext3fs_dirhash(entry->name, entry->len, hinfo); 371 ext3fs_dirhash(entry->name, entry->len, hinfo);
@@ -632,6 +634,9 @@ int ext3_htree_fill_tree(struct file *dir_file, __u32 start_hash,
632 dir = dir_file->f_path.dentry->d_inode; 634 dir = dir_file->f_path.dentry->d_inode;
633 if (!(EXT3_I(dir)->i_flags & EXT3_INDEX_FL)) { 635 if (!(EXT3_I(dir)->i_flags & EXT3_INDEX_FL)) {
634 hinfo.hash_version = EXT3_SB(dir->i_sb)->s_def_hash_version; 636 hinfo.hash_version = EXT3_SB(dir->i_sb)->s_def_hash_version;
637 if (hinfo.hash_version <= DX_HASH_TEA)
638 hinfo.hash_version +=
639 EXT3_SB(dir->i_sb)->s_hash_unsigned;
635 hinfo.seed = EXT3_SB(dir->i_sb)->s_hash_seed; 640 hinfo.seed = EXT3_SB(dir->i_sb)->s_hash_seed;
636 count = htree_dirblock_to_tree(dir_file, dir, 0, &hinfo, 641 count = htree_dirblock_to_tree(dir_file, dir, 0, &hinfo,
637 start_hash, start_minor_hash); 642 start_hash, start_minor_hash);
@@ -1152,9 +1157,9 @@ static struct ext3_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
1152 u32 hash2; 1157 u32 hash2;
1153 struct dx_map_entry *map; 1158 struct dx_map_entry *map;
1154 char *data1 = (*bh)->b_data, *data2; 1159 char *data1 = (*bh)->b_data, *data2;
1155 unsigned split, move, size, i; 1160 unsigned split, move, size;
1156 struct ext3_dir_entry_2 *de = NULL, *de2; 1161 struct ext3_dir_entry_2 *de = NULL, *de2;
1157 int err = 0; 1162 int err = 0, i;
1158 1163
1159 bh2 = ext3_append (handle, dir, &newblock, &err); 1164 bh2 = ext3_append (handle, dir, &newblock, &err);
1160 if (!(bh2)) { 1165 if (!(bh2)) {
@@ -1394,6 +1399,8 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
1394 1399
1395 /* Initialize as for dx_probe */ 1400 /* Initialize as for dx_probe */
1396 hinfo.hash_version = root->info.hash_version; 1401 hinfo.hash_version = root->info.hash_version;
1402 if (hinfo.hash_version <= DX_HASH_TEA)
1403 hinfo.hash_version += EXT3_SB(dir->i_sb)->s_hash_unsigned;
1397 hinfo.seed = EXT3_SB(dir->i_sb)->s_hash_seed; 1404 hinfo.seed = EXT3_SB(dir->i_sb)->s_hash_seed;
1398 ext3fs_dirhash(name, namelen, &hinfo); 1405 ext3fs_dirhash(name, namelen, &hinfo);
1399 frame = frames; 1406 frame = frames;