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

Peter Jeremy peter at rulingia.com
Mon May 16 20:06:15 UTC 2016


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.

-- 
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20160517/2807a8e6/attachment.sig>


More information about the freebsd-fs mailing list