public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@linux.intel.com>
To: Theodore Tso <tytso@mit.edu>
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: Mon, 15 Dec 2025 07:04:37 -0800	[thread overview]
Message-ID: <aUAjhXgqjrtWXjEw@tassilo> (raw)
In-Reply-To: <20251212233537.GC88311@macsyma.local>

On Sat, Dec 13, 2025 at 08:35:37AM +0900, Theodore Tso wrote:
> 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

With the bs>page size support this special use case could use larger 
blocks.

> 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.

You would only need to store the overflow, and I assume most uses 
would be much shorter anyways. But yes it would add some limit
to the number of file names, but perhaps with a 64k and an average 
more toward 200 bytes it isn't that bad.

> 
> 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.

You could do the hash still on the original directory, and then
perhaps use 4 bytes of the original file name to point to an
xattr offset for the overflow. This would be incompatible of course,
but not too far from original ext4.

Perhaps it would also need something to have an efficient free list
in the xattr, or maybe that could be just done in memory.

-Andi

      reply	other threads:[~2025-12-15 15:04 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
2025-12-15 15:04           ` Andi Kleen [this message]

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=aUAjhXgqjrtWXjEw@tassilo \
    --to=ak@linux.intel.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    --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