diff options
author | Daeho Jeong <daeho.jeong@samsung.com> | 2016-07-03 21:11:08 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2016-07-03 21:11:08 -0400 |
commit | fa96454069b85a7e5d10f38b7d95edcd5dc64b9a (patch) | |
tree | c3e810170e7e389b0bdd6583d0a7b2c01352d04f | |
parent | b47820edd1634dc1208f9212b7ecfb4230610a23 (diff) |
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>
-rw-r--r-- | fs/ext4/namei.c | 4 |
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, | |||
445 | c = get_dx_countlimit(inode, dirent, &count_offset); | 445 | c = get_dx_countlimit(inode, dirent, &count_offset); |
446 | if (!c) { | 446 | if (!c) { |
447 | EXT4_ERROR_INODE(inode, "dir seems corrupt? Run e2fsck -D."); | 447 | EXT4_ERROR_INODE(inode, "dir seems corrupt? Run e2fsck -D."); |
448 | return 1; | 448 | return 0; |
449 | } | 449 | } |
450 | limit = le16_to_cpu(c->limit); | 450 | limit = le16_to_cpu(c->limit); |
451 | count = le16_to_cpu(c->count); | 451 | count = le16_to_cpu(c->count); |
452 | if (count_offset + (limit * sizeof(struct dx_entry)) > | 452 | if (count_offset + (limit * sizeof(struct dx_entry)) > |
453 | EXT4_BLOCK_SIZE(inode->i_sb) - sizeof(struct dx_tail)) { | 453 | EXT4_BLOCK_SIZE(inode->i_sb) - sizeof(struct dx_tail)) { |
454 | warn_no_space_for_csum(inode); | 454 | warn_no_space_for_csum(inode); |
455 | return 1; | 455 | return 0; |
456 | } | 456 | } |
457 | t = (struct dx_tail *)(((struct dx_entry *)c) + limit); | 457 | t = (struct dx_tail *)(((struct dx_entry *)c) + limit); |
458 | 458 | ||