public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: zhangshida <starzhangzsd@gmail.com>
Cc: stable@vger.kernel.org, Shida Zhang <zhangshida@kylinos.cn>,
	stable@kernel.org, Andreas Dilger <adilger@dilger.ca>,
	"Darrick J . Wong" <djwong@kernel.org>,
	Theodore Ts'o <tytso@mit.edu>
Subject: Re: [PATCH] ext4: fix rec_len verify error
Date: Fri, 22 Sep 2023 11:23:59 +0200	[thread overview]
Message-ID: <2023092232-squash-buggy-51c7@gregkh> (raw)
In-Reply-To: <20230922053915.2176290-1-zhangshida@kylinos.cn>

On Fri, Sep 22, 2023 at 01:39:15PM +0800, zhangshida wrote:
> From: Shida Zhang <zhangshida@kylinos.cn>
> 
> [ Upstream commit 7fda67e8c3ab6069f75888f67958a6d30454a9f6 ]
> 
> With the configuration PAGE_SIZE 64k and filesystem blocksize 64k,
> a problem occurred when more than 13 million files were directly created
> under a directory:
> 
> EXT4-fs error (device xx): ext4_dx_csum_set:492: inode #xxxx: comm xxxxx: dir seems corrupt?  Run e2fsck -D.
> EXT4-fs error (device xx): ext4_dx_csum_verify:463: inode #xxxx: comm xxxxx: dir seems corrupt?  Run e2fsck -D.
> EXT4-fs error (device xx): dx_probe:856: inode #xxxx: block 8188: comm xxxxx: Directory index failed checksum
> 
> When enough files are created, the fake_dirent->reclen will be 0xffff.
> it doesn't equal to the blocksize 65536, i.e. 0x10000.
> 
> But it is not the same condition when blocksize equals to 4k.
> when enough files are created, the fake_dirent->reclen will be 0x1000.
> it equals to the blocksize 4k, i.e. 0x1000.
> 
> The problem seems to be related to the limitation of the 16-bit field
> when the blocksize is set to 64k.
> To address this, helpers like ext4_rec_len_{from,to}_disk has already
> been introduced to complete the conversion between the encoded and the
> plain form of rec_len.
> 
> So fix this one by using the helper, and all the other in this file too.
> 
> Cc: stable@kernel.org
> Fixes: dbe89444042a ("ext4: Calculate and verify checksums for htree nodes")
> Suggested-by: Andreas Dilger <adilger@dilger.ca>
> Suggested-by: Darrick J. Wong <djwong@kernel.org>
> Signed-off-by: Shida Zhang <zhangshida@kylinos.cn>
> Reviewed-by: Andreas Dilger <adilger@dilger.ca>
> Reviewed-by: Darrick J. Wong <djwong@kernel.org>
> Link: https://lore.kernel.org/r/20230803060938.1929759-1-zhangshida@kylinos.cn
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> Signed-off-by: Shida Zhang <zhangshida@kylinos.cn>
> ---
>  fs/ext4/namei.c | 26 +++++++++++++++-----------
>  1 file changed, 15 insertions(+), 11 deletions(-)

What stable tree(s) are you asking this to be backported to?

thanks,

greg k-h

  reply	other threads:[~2023-09-22  9:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20  9:58 FAILED: patch "[PATCH] ext4: fix rec_len verify error" failed to apply to 4.14-stable tree gregkh
2023-09-22  5:39 ` [PATCH] ext4: fix rec_len verify error zhangshida
2023-09-22  9:23   ` Greg KH [this message]
2023-09-22 15:11     ` Theodore Ts'o
2023-09-24  2:19 ` [PATCH 4.14.y] " zhangshida
2023-10-07 10:19   ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2023-09-20  9:58 FAILED: patch "[PATCH] ext4: fix rec_len verify error" failed to apply to 4.19-stable tree gregkh
2023-09-22  2:54 ` [PATCH] ext4: fix rec_len verify error zhangshida
2023-09-22  9:27   ` Greg KH
2023-09-23  9:41     ` Stephen Zhang
2023-09-23 14:47       ` Theodore Ts'o
2023-09-23 16:10         ` Greg KH

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=2023092232-squash-buggy-51c7@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=adilger@dilger.ca \
    --cc=djwong@kernel.org \
    --cc=stable@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=starzhangzsd@gmail.com \
    --cc=tytso@mit.edu \
    --cc=zhangshida@kylinos.cn \
    /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