All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] ext4: correct error value of function verifying dx checksum
@ 2016-07-04  0:15 Daeho Jeong
  2016-07-04  1:12 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Daeho Jeong @ 2016-07-04  0:15 UTC (permalink / raw)
  To: tytso, linux-ext4; +Cc: Daeho Jeong

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>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/ext4/namei.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 48e4b89..ec811bb 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -446,14 +446,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);
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH RESEND] ext4: correct error value of function verifying dx checksum
  2016-07-04  0:15 [PATCH RESEND] ext4: correct error value of function verifying dx checksum Daeho Jeong
@ 2016-07-04  1:12 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2016-07-04  1:12 UTC (permalink / raw)
  To: Daeho Jeong; +Cc: linux-ext4

On Mon, Jul 04, 2016 at 09:15:04AM +0900, Daeho Jeong wrote:
> 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>
> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

Thanks, applied.

					- Ted

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-04  1:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-04  0:15 [PATCH RESEND] ext4: correct error value of function verifying dx checksum Daeho Jeong
2016-07-04  1:12 ` Theodore Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.