1 ext4: correct error value of function verifying dx checksum
3 From: Daeho Jeong <daeho.jeong@samsung.com>
5 ext4_dx_csum_verify() returns the success return value in two checksum
6 verification failure cases. We need to set the return values to zero
7 as failure like ext4_dirent_csum_verify() returning zero when failing
8 to find a checksum dirent at the tail.
10 Signed-off-by: Daeho Jeong <daeho.jeong@samsung.com>
11 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
14 fs/ext4/namei.c | 4 ++--
15 1 file changed, 2 insertions(+), 2 deletions(-)
17 diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
18 index 48e4b89..ec811bb 100644
21 @@ -446,14 +446,14 @@ static int ext4_dx_csum_verify(struct inode *inode,
22 c = get_dx_countlimit(inode, dirent, &count_offset);
24 EXT4_ERROR_INODE(inode, "dir seems corrupt? Run e2fsck -D.");
28 limit = le16_to_cpu(c->limit);
29 count = le16_to_cpu(c->count);
30 if (count_offset + (limit * sizeof(struct dx_entry)) >
31 EXT4_BLOCK_SIZE(inode->i_sb) - sizeof(struct dx_tail)) {
32 warn_no_space_for_csum(inode);
36 t = (struct dx_tail *)(((struct dx_entry *)c) + limit);