summaryrefslogtreecommitdiff
path: root/fs/ext4/namei.c
diff options
context:
space:
mode:
authorDaeho Jeong <daeho.jeong@samsung.com>2016-07-04 04:11:08 +0300
committerTheodore Ts'o <tytso@mit.edu>2016-07-04 04:11:08 +0300
commitfa96454069b85a7e5d10f38b7d95edcd5dc64b9a (patch)
treec3e810170e7e389b0bdd6583d0a7b2c01352d04f /fs/ext4/namei.c
parentb47820edd1634dc1208f9212b7ecfb4230610a23 (diff)
downloadlinux-fa96454069b85a7e5d10f38b7d95edcd5dc64b9a.tar.xz
ext4: correct error value of function verifying dx checksum
ext4_dx_csum_verify() returns the success return value in two checksum verification failure cases. We need to set the return values to zero as failure like ext4_dirent_csum_verify() returning zero when failing to find a checksum dirent at the tail. Signed-off-by: Daeho Jeong <daeho.jeong@samsung.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r--fs/ext4/namei.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 5bb46b6ed456..94d22e78a7dd 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -445,14 +445,14 @@ static int ext4_dx_csum_verify(struct inode *inode,
c = get_dx_countlimit(inode, dirent, &count_offset);
if (!c) {
EXT4_ERROR_INODE(inode, "dir seems corrupt? Run e2fsck -D.");
- return 1;
+ return 0;
}
limit = le16_to_cpu(c->limit);
count = le16_to_cpu(c->count);
if (count_offset + (limit * sizeof(struct dx_entry)) >
EXT4_BLOCK_SIZE(inode->i_sb) - sizeof(struct dx_tail)) {
warn_no_space_for_csum(inode);
- return 1;
+ return 0;
}
t = (struct dx_tail *)(((struct dx_entry *)c) + limit);