Skip to content

Commit

Permalink
ext4: fix incorrect offset
Browse files Browse the repository at this point in the history
The last argument of ext4_check_dir_entry is dentry offset int the
file.  Luckily this error only results in the wrong offset being
printed in the eventual error message.

Signed-off-by: Wang Jianjian <wangjianjian0@foxmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/tencent_F992989953734FD5DE3F88ECB2191A856206@qq.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
  • Loading branch information
Wang Jianjian authored and Theodore Ts'o committed Oct 6, 2023
1 parent 8e387c8 commit 8fedebb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/ext4/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2280,8 +2280,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;
Expand Down

0 comments on commit 8fedebb

Please sign in to comment.