public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Tso" <tytso@mit.edu>
To: Andi Kleen <ak@linux.intel.com>
Cc: Winston Wen <wentao@uniontech.com>, linux-ext4@vger.kernel.org
Subject: Re: Inquiry: Possible built-in support for longer filenames in ext4 (beyond 256 bytes)
Date: Sat, 13 Dec 2025 08:35:37 +0900	[thread overview]
Message-ID: <20251212233537.GC88311@macsyma.local> (raw)
In-Reply-To: <87pl8jzi3n.fsf@linux.intel.com>

On Fri, Dec 12, 2025 at 10:10:36AM -0800, Andi Kleen wrote:
> 
> Perhaps you could use xattrs on the directory inode to store the longer
> names, or the overflow.
> 
> One problem is that they may need to be big, exceeding xattr
> limits, but perhaps some total limit on the longer file names
> would be acceptable.

With ext4, there is a limit of a single file system block for all
extended attributes.  You can store the value of extended attribute in
an inode, in which case you only have the four byte inode number in
the xattr block.  But still, if you assume 16 bytes of overhead for
each xattr entry, plus the xattr header, there's only room for 9 400
byte directory entries.

And you wouldn't want to have a lot of directory entries stored in
xattrs anyway, since searching them would have to be a brute force,
O(n) search.  You wouldn't be able to use a hash tree for fast
lookups.

So even if you didn't have the xattr limits, if you had a large number
of very long file names stored in xattrs, it would be a performance
disaster.

Cheers,

						- Ted





  reply	other threads:[~2025-12-12 23:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-10  7:02 Inquiry: Possible built-in support for longer filenames in ext4 (beyond 256 bytes) Winston Wen
2025-12-10  9:05 ` Theodore Tso
2025-12-10  9:32   ` Winston Wen
2025-12-10 23:24     ` Theodore Tso
2025-12-11  1:21       ` Winston Wen
2025-12-12 18:10       ` Andi Kleen
2025-12-12 23:35         ` Theodore Tso [this message]
2025-12-15 15:04           ` Andi Kleen

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=20251212233537.GC88311@macsyma.local \
    --to=tytso@mit.edu \
    --cc=ak@linux.intel.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=wentao@uniontech.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