Bigger MAX_PATH (Was: Re: State of native encryption in ZFS)

Willem Jan Withagen wjw at digiware.nl
Tue May 17 08:42:48 UTC 2016


On 16-5-2016 22:05, Peter Jeremy wrote:
> On 2016-May-16 15:18:17 +0200, Willem Jan Withagen <wjw at digiware.nl> wrote:
>> Trying to port Ceph is also running into the limit in:
>> /usr/include/sys/syslimits.h:
>> #define NAME_MAX        255  /* max bytes in a file name */
>>
>> but I also found:
>> /usr/include/stdio.h:
>> #define FILENAME_MAX    1024 /* must be <= PATH_MAX <sys/syslimits.h> */
>>
>> So take a pick??
>
> There are two distinct limits: The maximum number of characters in a
> pathname component (ie the name seen in a directory entry):  For UFS,
> this is 255 because the length is stored on disk in a uint8_t (I don't
> know the limit for ZFS).  The other limit is the maximum number of
> characters in a pathname - PATH_MAX.  This is used to dimension various
> buffers but isn't persistent on disk so you should be able to increase
> it by changing the relevant #defines and rebuilding everything.

Don't remeber if I did such an experiment.
Got to talk to the local engineer of dutie here to see if I can get a few
more VMs to go compile and blow up. :)

Getting the NAME_MAX size per fs is something I'm going to need in the
long run for Ceph to make optimal usage of its capabilities.

I think that Linux is now at 1024, and the underlaying store for Ceph
is going to 4096.....

--WjW



More information about the freebsd-fs mailing list