diff options
Diffstat (limited to 'fs/ext4/dir.c')
-rw-r--r-- | fs/ext4/dir.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c index b86786202643..aa39e600d159 100644 --- a/fs/ext4/dir.c +++ b/fs/ext4/dir.c | |||
@@ -179,6 +179,18 @@ static int ext4_readdir(struct file *filp, | |||
179 | continue; | 179 | continue; |
180 | } | 180 | } |
181 | 181 | ||
182 | /* Check the checksum */ | ||
183 | if (!buffer_verified(bh) && | ||
184 | !ext4_dirent_csum_verify(inode, | ||
185 | (struct ext4_dir_entry *)bh->b_data)) { | ||
186 | EXT4_ERROR_FILE(filp, 0, "directory fails checksum " | ||
187 | "at offset %llu", | ||
188 | (unsigned long long)filp->f_pos); | ||
189 | filp->f_pos += sb->s_blocksize - offset; | ||
190 | continue; | ||
191 | } | ||
192 | set_buffer_verified(bh); | ||
193 | |||
182 | revalidate: | 194 | revalidate: |
183 | /* If the dir block has changed since the last call to | 195 | /* If the dir block has changed since the last call to |
184 | * readdir(2), then we might be pointing to an invalid | 196 | * readdir(2), then we might be pointing to an invalid |