Re: [PATCH] ext4: Fix incorrect offset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu 24-08-23 23:23:24, Wang Jianjian wrote:
> The last argumen of ext4_check_dir_entry is dentry offset
           ^^^ argument

> 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.
 
> Signed-off-by: Wang Jianjian <wangjianjian0@xxxxxxxxxxx>

Otherwise the fix looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@xxxxxxx>

								Honza

> ---
>  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
> 
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux