linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] ext4: report error if things go wrong when do checksum
@ 2013-01-05  7:42 Guo Chao
  2013-01-05  7:43 ` [PATCH 2/3] ext4: release buffer in failed path in dx_probe() Guo Chao
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Guo Chao @ 2013-01-05  7:42 UTC (permalink / raw)
  To: tytso; +Cc: linux-ext4, Darrick J. Wong

In ext4_dx_csum_verify(), if we detect corrupted data,
we do not compare checksum because checksum itself may
be wrong, but we should report error in this case.

Cc: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Guo Chao <yan@linux.vnet.ibm.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 cac4482..843e29f 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -370,14 +370,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] 9+ messages in thread

end of thread, other threads:[~2013-01-07  4:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-05  7:42 [PATCH 1/3] ext4: report error if things go wrong when do checksum Guo Chao
2013-01-05  7:43 ` [PATCH 2/3] ext4: release buffer in failed path in dx_probe() Guo Chao
2013-01-05 19:41   ` Darrick J. Wong
2013-01-07  4:24     ` Theodore Ts'o
2013-01-05  7:43 ` [PATCH 3/3] ext4: remove duplicate assignment in ext4_init_new_dir() Guo Chao
2013-01-05  8:05   ` Tao Ma
2013-01-07  4:37   ` Theodore Ts'o
2013-01-05 19:50 ` [PATCH 1/3] ext4: report error if things go wrong when do checksum Darrick J. Wong
2013-01-06  2:37   ` Guo Chao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).