diff options
-rw-r--r-- | fs/ext4/namei.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index f2bc160463b7..07eb6649e4fa 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -749,7 +749,7 @@ static int dx_make_map(struct ext4_dir_entry_2 *de, unsigned blocksize, | |||
749 | ext4fs_dirhash(de->name, de->name_len, &h); | 749 | ext4fs_dirhash(de->name, de->name_len, &h); |
750 | map_tail--; | 750 | map_tail--; |
751 | map_tail->hash = h.hash; | 751 | map_tail->hash = h.hash; |
752 | map_tail->offs = (u16) ((char *) de - base); | 752 | map_tail->offs = ((char *) de - base)>>2; |
753 | map_tail->size = le16_to_cpu(de->rec_len); | 753 | map_tail->size = le16_to_cpu(de->rec_len); |
754 | count++; | 754 | count++; |
755 | cond_resched(); | 755 | cond_resched(); |
@@ -1147,7 +1147,8 @@ dx_move_dirents(char *from, char *to, struct dx_map_entry *map, int count, | |||
1147 | unsigned rec_len = 0; | 1147 | unsigned rec_len = 0; |
1148 | 1148 | ||
1149 | while (count--) { | 1149 | while (count--) { |
1150 | struct ext4_dir_entry_2 *de = (struct ext4_dir_entry_2 *) (from + map->offs); | 1150 | struct ext4_dir_entry_2 *de = (struct ext4_dir_entry_2 *) |
1151 | (from + (map->offs<<2)); | ||
1151 | rec_len = EXT4_DIR_REC_LEN(de->name_len); | 1152 | rec_len = EXT4_DIR_REC_LEN(de->name_len); |
1152 | memcpy (to, de, rec_len); | 1153 | memcpy (to, de, rec_len); |
1153 | ((struct ext4_dir_entry_2 *) to)->rec_len = | 1154 | ((struct ext4_dir_entry_2 *) to)->rec_len = |