diff options
author | Wang Jianjian <wangjianjian0@foxmail.com> | 2023-08-24 23:23:24 +0800 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2023-10-05 22:32:14 -0400 |
commit | 8fedebb5ea183994aca39af3f80623f5db42fff7 (patch) | |
tree | f86f34f5b79c77020ec02b1ca2514bdf01454bf0 | |
parent | 8e387c89e96b9543a339f84043cf9df15fed2632 (diff) | |
download | lwn-8fedebb5ea183994aca39af3f80623f5db42fff7.tar.gz lwn-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>
-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; |