diff options
author | Wang Jianjian <wangjianjian0@foxmail.com> | 2023-08-24 17:23:24 +0200 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2023-10-06 04:32:14 +0200 |
commit | 8fedebb5ea183994aca39af3f80623f5db42fff7 (patch) | |
tree | f86f34f5b79c77020ec02b1ca2514bdf01454bf0 /fs/ext4 | |
parent | ext4: make sure allocate pending entry not fail (diff) | |
download | linux-8fedebb5ea183994aca39af3f80623f5db42fff7.tar.xz linux-8fedebb5ea183994aca39af3f80623f5db42fff7.zip |
ext4: fix incorrect offset
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>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/namei.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index bbda587f76b8..cbe756144d8d 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -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; |