Document share name length limitation
When a snapshot name is too long because of the concatenation of volume name + parent dataset name + dataset_name + snapshot name with to much long volume/datasets names the snapshot was not available into the Samba share.
For example if you create a volume called customer-vol-zpool-01 with a dataset named customer-dts-sambashares-01 and a child dataset named customer-dts-mypublicshare-01 then you create a automatic snapshot task with recursive option set on on customer-dts-sambashares-01 and share the dataset dts-mypublicshare-01 you not able to see any snapshots on this share.
If you try to listen the .zfs/snapshot directory with the ls command on the NAS for the dataset customer-mypublicshare-01 you got a "File name too long" on this directory.
#2 Updated by Timur Bakeyev over 3 years ago
- Status changed from Unscreened to 15
- Target version set to N/A
A lot of system limits are defined in the
/usr/include/sys/syslimits.h, in particular
#define PATH_MAX 1024 /* max bytes in pathname */
This defines the maximum size of a string with single pathname. There is a correlated
NAME_MAX limit, that defines how much single element of the pathname aka filename(or directory name) may take:
#define NAME_MAX 255 /* max bytes in a file name */
But that's not the end of the story. Path for the mounted ZFS dataset or any other mounted filesystem can't exceed
MNAMELEN according to
#define MNAMELEN 88 /* size of on/from name bufs */ ... char f_mntfromname[MNAMELEN]; /* mounted filesystem */ char f_mntonname[MNAMELEN]; /* directory on which mounted */
I believe that the user actually experienced that limitation, as hitting 1024 bytes limit is quite hard.
It's amusing that the problem exists at least since 2010 - https://lists.freebsd.org/pipermail/freebsd-fs/2010-March/007964.html.
The good thing is that it's going to be finally addressed in FreeBSD 12.x https://lists.freebsd.org/pipermail/freebsd-fs/2017-April/024684.html
#7 Updated by Warren Block over 3 years ago
- Subject changed from Document share length limitation to Document share name length limitation
- Status changed from Unscreened to Resolved
A note on path and name length limitations has already been added in https://github.com/freenas/freenas-docs/commit/1f92e004a5b47a9f4a01a4a3faa088c9ff462191
Live version at: http://doc.freenas.org/11/intro.html#path-and-name-lengths
I'm hesitant to add a note about FreeBSD 12 fixing this because there is no firm timeline for when it will be available.