linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Wang Jianjian <wangjianjian0@foxmail.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH] ext4: Fix incorrect offset
Date: Mon, 18 Sep 2023 16:51:10 +0200	[thread overview]
Message-ID: <20230918145110.nzma56rirpw3hpg7@quack3> (raw)
In-Reply-To: <tencent_F992989953734FD5DE3F88ECB2191A856206@qq.com>

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@foxmail.com>

Otherwise the fix looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								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@suse.com>
SUSE Labs, CR

  reply	other threads:[~2023-09-18 15:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24 15:23 [PATCH] ext4: Fix incorrect offset Wang Jianjian
2023-09-18 14:51 ` Jan Kara [this message]
2023-10-06 18:06 ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230918145110.nzma56rirpw3hpg7@quack3 \
    --to=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=wangjianjian0@foxmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).