Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309940
b: refs/heads/master
c: b0336e8
h: refs/heads/master
v: v3
  • Loading branch information
Darrick J. Wong authored and Theodore Ts'o committed Apr 29, 2012
1 parent c01c022 commit 34f6b1f
Show file tree
Hide file tree
Showing 4 changed files with 260 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dbe89444042ab6540bc304343cfdcbc8b95d003d
refs/heads/master: b0336e8d2108e6302aecaadd17c6c0bd686da22d
12 changes: 12 additions & 0 deletions trunk/fs/ext4/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,18 @@ static int ext4_readdir(struct file *filp,
continue;
}

/* Check the checksum */
if (!buffer_verified(bh) &&
!ext4_dirent_csum_verify(inode,
(struct ext4_dir_entry *)bh->b_data)) {
EXT4_ERROR_FILE(filp, 0, "directory fails checksum "
"at offset %llu",
(unsigned long long)filp->f_pos);
filp->f_pos += sb->s_blocksize - offset;
continue;
}
set_buffer_verified(bh);

revalidate:
/* If the dir block has changed since the last call to
* readdir(2), then we might be pointing to an invalid
Expand Down
2 changes: 2 additions & 0 deletions trunk/fs/ext4/ext4.h
Original file line number Diff line number Diff line change
Expand Up @@ -2019,6 +2019,8 @@ extern long ext4_compat_ioctl(struct file *, unsigned int, unsigned long);
extern int ext4_ext_migrate(struct inode *);

/* namei.c */
extern int ext4_dirent_csum_verify(struct inode *inode,
struct ext4_dir_entry *dirent);
extern int ext4_orphan_add(handle_t *, struct inode *);
extern int ext4_orphan_del(handle_t *, struct inode *);
extern int ext4_htree_fill_tree(struct file *dir_file, __u32 start_hash,
Expand Down
Loading

0 comments on commit 34f6b1f

Please sign in to comment.