From: "Theodore Ts'o" <tytso@mit.edu>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: Catalin Patulea <cronos586@gmail.com>,
linux-ext4@vger.kernel.org, Kazuya Mio <k-mio@sx.jp.nec.com>
Subject: Re: e2fsck max blocks for huge non-extent file
Date: Mon, 13 Jan 2025 14:26:03 -0500 [thread overview]
Message-ID: <20250113192603.GA1950906@mit.edu> (raw)
In-Reply-To: <20250113183517.GC6152@frogsfrogsfrogs>
On Mon, Jan 13, 2025 at 10:35:17AM -0800, Darrick J. Wong wrote:
>
> Hmm -- num_blocks is ... the number of "extent records", right? And on
> a !extents file, each block mapped by an {in,}direct block counts as a
> separate "extent record", right?
>
> In that case, I think (1U<<31) isn't quite right, because the very large
> file could have an ACL block, or (shudder) a "hurd translator block".
> So that's (1U<<31) + 2 for !extents files.
>
> For extents files, shouldn't this be (1U<<48) + 2? Since you /could/
> create a horrifingly large extent tree with a hojillion little
> fragments, right? Even if it took a million years to create such a
> monster? :)
The code paths in question are only used for indirect mapped files.
The logic for handling extent-mapped files is check_blocks_extents()
in modern versions of e2fsprogs, which is why Catalin was only seeing
this for an ext3 file systems that had huge_file enabled.
You're right though that we shouldn't be using num_blocks at all for
testing for regular files or directory files that are too big, since
num_blocks include blocks for extended attribute blocks, the
ind/dind/tind blocks, etc. We do care about num_blocks being too big
for the !huge_file case since for !huge_file file systems i_blocks is
denominated in 512 byte units, and is only 32-bits wide. So in that
case, we *do* care about the size of the file including metadata
blocks being no more than 2TiB.
- Ted
next prev parent reply other threads:[~2025-01-13 19:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAE2LqHL6uY=Sq2+aVtW-Lkbu9mvjFkaNqLaDA8Bkpmvx9AjHBg@mail.gmail.com>
2025-01-13 16:33 ` e2fsck max blocks for huge non-extent file Theodore Ts'o
2025-01-13 18:35 ` Darrick J. Wong
2025-01-13 19:26 ` Theodore Ts'o [this message]
2025-01-17 3:26 ` Catalin Patulea
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=20250113192603.GA1950906@mit.edu \
--to=tytso@mit.edu \
--cc=cronos586@gmail.com \
--cc=djwong@kernel.org \
--cc=k-mio@sx.jp.nec.com \
--cc=linux-ext4@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.