aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/namei.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index ab16beaa830d..384f1222602a 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -993,19 +993,21 @@ static struct buffer_head * ext4_dx_find_entry(struct dentry *dentry,
993 de = (struct ext4_dir_entry_2 *) bh->b_data; 993 de = (struct ext4_dir_entry_2 *) bh->b_data;
994 top = (struct ext4_dir_entry_2 *) ((char *) de + sb->s_blocksize - 994 top = (struct ext4_dir_entry_2 *) ((char *) de + sb->s_blocksize -
995 EXT4_DIR_REC_LEN(0)); 995 EXT4_DIR_REC_LEN(0));
996 for (; de < top; de = ext4_next_entry(de)) 996 for (; de < top; de = ext4_next_entry(de)) {
997 if (ext4_match (namelen, name, de)) { 997 int off = (block << EXT4_BLOCK_SIZE_BITS(sb))
998 if (!ext4_check_dir_entry("ext4_find_entry", 998 + ((char *) de - bh->b_data);
999 dir, de, bh, 999
1000 (block<<EXT4_BLOCK_SIZE_BITS(sb)) 1000 if (!ext4_check_dir_entry(__func__, dir, de, bh, off)) {
1001 +((char *)de - bh->b_data))) { 1001 brelse(bh);
1002 brelse (bh);
1003 *err = ERR_BAD_DX_DIR; 1002 *err = ERR_BAD_DX_DIR;
1004 goto errout; 1003 goto errout;
1005 } 1004 }
1006 *res_dir = de; 1005
1007 dx_release (frames); 1006 if (ext4_match(namelen, name, de)) {
1008 return bh; 1007 *res_dir = de;
1008 dx_release(frames);
1009 return bh;
1010 }
1009 } 1011 }
1010 brelse (bh); 1012 brelse (bh);
1011 /* Check to see if we should continue to search */ 1013 /* Check to see if we should continue to search */