The last argumen of ext4_check_dir_entry is dentry offset int the file. Signed-off-by: Wang Jianjian <wangjianjian0@xxxxxxxxxxx> --- 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