linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: Fix incorrect offset
@ 2023-08-24 15:23 Wang Jianjian
  2023-09-18 14:51 ` Jan Kara
  2023-10-06 18:06 ` Theodore Ts'o
  0 siblings, 2 replies; 3+ messages in thread
From: Wang Jianjian @ 2023-08-24 15:23 UTC (permalink / raw)
  To: linux-ext4; +Cc: Wang Jianjian

The last argumen of ext4_check_dir_entry is dentry offset
int the file.

Signed-off-by: Wang Jianjian <wangjianjian0@foxmail.com>
---
 fs/ext4/namei.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 94608b7df7e8..33ebd35025bf 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2261,8 +2261,7 @@ static int make_indexed_dir(handle_t *handle, struct ext4_filename *fname,
 	top = data2 + len;
 	while ((char *)(de2 = ext4_next_entry(de, blocksize)) < top) {
 		if (ext4_check_dir_entry(dir, NULL, de, bh2, data2, len,
-					 (data2 + (blocksize - csum_size) -
-					  (char *) de))) {
+					(char *)de - data2)) {
 			brelse(bh2);
 			brelse(bh);
 			return -EFSCORRUPTED;
-- 
2.34.3


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

end of thread, other threads:[~2023-10-06 18:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-24 15:23 [PATCH] ext4: Fix incorrect offset Wang Jianjian
2023-09-18 14:51 ` Jan Kara
2023-10-06 18:06 ` Theodore Ts'o

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).