[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2EB6F335572BB77B+20251210173202.58c83465@winn-pc>
Date: Wed, 10 Dec 2025 17:32:02 +0800
From: Winston Wen <wentao@...ontech.com>
To: "Theodore Tso" <tytso@....edu>
Cc: linux-ext4@...r.kernel.org
Subject: Re: Inquiry: Possible built-in support for longer filenames in ext4
(beyond 256 bytes)
On Wed, 10 Dec 2025 18:05:36 +0900
"Theodore Tso" <tytso@....edu> wrote:
> On Wed, Dec 10, 2025 at 03:02:11PM +0800, Winston Wen wrote:
> > We are aware that workarounds like wrapfs can be used to support
> > longer filenames, but in practice, this approach is not ideal for
> > seamless user experience. We are therefore curious whether it would
> > be feasible to implement built-in support for longer filenames in
> > ext4 itself.
>
> I don't think wrapfs can be used to support logner file names, because
> the limitation is quite fundamental. For example, the glibc
> definition of struct dirent (which is returned by the readdir() system
> call) is as follows (from the man readdir page):
>
> struct dirent {
> ino_t d_ino; /* Inode number */
> off_t d_off; /* Not an offset; see
> below */ unsigned short d_reclen; /* Length of this record */
> unsigned char d_type; /* Type of file; not
> supported by all filesystem types */
> char d_name[256]; /* Null-terminated
> filename */ };
>
> So how you might store the longer file name isn't really going to
> help, the problem goes far beyond the question of where this might be
> stored on the file system.
>
> - Ted
>
Hi Ted,
Thank you for your quick and insightful reply.
I apologize if I’ve misunderstood something, but based on our
experience, we have actually implemented and deployed two different
solutions using FUSE and wrapfs in our production environment, both of
which successfully support filenames longer than 256 bytes. This leads
us to believe that the glibc and VFS layers do not impose a hard limit
at 256 bytes in practice.
To better understand, I’ve reviewed the readdir/getdents man pages and
the glibc struct dirent definition. It appears that d_name is
implemented as a flexible array member rather than a fixed-size array
of 256 bytes.
Going back to our original question: we were curious whether it might
be possible to support longer filenames natively within ext4 itself
(rather than through FUSE), perhaps via on-disk format extension or
auxiliary storage like xattrs. If this is architecturally feasible, we
would be very interested in exploring it further.
Any further guidance or references you could share would be greatly
appreciated.
Thanks again for your time.
--
Thanks,
Winston
Powered by blists - more mailing lists