diff options
-rw-r--r-- | fs/ext4/namei.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 580af3dfc0eb..88e9a2c7e328 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -1146,6 +1146,21 @@ static inline int search_dirblock(struct buffer_head *bh, | |||
1146 | return 0; | 1146 | return 0; |
1147 | } | 1147 | } |
1148 | 1148 | ||
1149 | static int is_dx_internal_node(struct inode *dir, ext4_lblk_t block, | ||
1150 | struct ext4_dir_entry *de) | ||
1151 | { | ||
1152 | struct super_block *sb = dir->i_sb; | ||
1153 | |||
1154 | if (!is_dx(dir)) | ||
1155 | return 0; | ||
1156 | if (block == 0) | ||
1157 | return 1; | ||
1158 | if (de->inode == 0 && | ||
1159 | ext4_rec_len_from_disk(de->rec_len, sb->s_blocksize) == | ||
1160 | sb->s_blocksize) | ||
1161 | return 1; | ||
1162 | return 0; | ||
1163 | } | ||
1149 | 1164 | ||
1150 | /* | 1165 | /* |
1151 | * ext4_find_entry() | 1166 | * ext4_find_entry() |
@@ -1246,6 +1261,8 @@ restart: | |||
1246 | goto next; | 1261 | goto next; |
1247 | } | 1262 | } |
1248 | if (!buffer_verified(bh) && | 1263 | if (!buffer_verified(bh) && |
1264 | !is_dx_internal_node(dir, block, | ||
1265 | (struct ext4_dir_entry *)bh->b_data) && | ||
1249 | !ext4_dirent_csum_verify(dir, | 1266 | !ext4_dirent_csum_verify(dir, |
1250 | (struct ext4_dir_entry *)bh->b_data)) { | 1267 | (struct ext4_dir_entry *)bh->b_data)) { |
1251 | EXT4_ERROR_INODE(dir, "checksumming directory " | 1268 | EXT4_ERROR_INODE(dir, "checksumming directory " |