ext4: Fix incorrect offset
PATCH 1/1 ext4: Fix incorrect offset
The last argumen of ext4_check_dir_entry is dentry offset int the file.
Signed-off-by Wang Jianjian <[email protected]>
--- fs/ext4/namei.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/ext4/namei.c +1 -2
@@ -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 ;
Signature · 1 line
2.34.3
Quoted 1 line · Wang Jianjian
The last argumen of
ext4_check_dir_entryis dentry offset
^^^ argument
Quoted 1 line
int the file.
^^ in the directory
Maybe you could also add to the changelog: Luckily this error only results in the wrong offset being printed in the eventual error message.
Quoted 1 line
Signed-off-by Wang Jianjian <[email protected]>
Otherwise the fix looks good. Feel free to add:
Reviewed-by Jan Kara <[email protected]>
Honza
Quoted 21 lines
--- fs/ext4/namei.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)fs/ext4/namei.c +1
-2@@ -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 ;Signature · 1 line
2.34.3
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Quoted 4 lines · Wang Jianjian
The last argumen of
ext4_check_dir_entryis dentry offset int the file.
Applied, thanks!
[1/1] ext4: Fix incorrect offset
commit: 8fedebb5ea183994aca39af3f80623f5db42fff7
Best regards,
Signature · 1 line
Theodore Ts'o <[email protected]>