Some further comments here:
- the VFS itself doesn't actually impose a NAME_MAX limit, which is why ZFS can even have 1024-character filenames
- what happens if there are different MDTs with different limits (e.g. two ZFS MDTs running different ZFS versions or pool configs during an upgrade)? Should the names be limited by the MDT a particular directory is on (which is the case today) or should there be a single limit across the whole filesystem to reduce confusion in userspace applications?
I suspect the root of the problem is that mdd_statfs() limiting os_namelen to NAME_MAX doesn't actually affect any filesystem operations on the OSD or client. Patch http://review.whamcloud.com/8217 ("LU-4219 mdd: limit os_namelen to the max of NAME_MAX") fixes the statfs.f_namelen value returned to userspace and quieted the fpathconf test failures in that ticket, but the MDT is actually depending on the OSD layer to enforce the namelen limit during file creation and truncating os_namelen doesn't change this. Since the ZFS limit is 256, it would (currently) allow filenames up to that limit to be created.
It likely makes sense that lmv_statfs() should find the minimum os_namelen() returned from any MDT when it is aggregating osfs->os_namelen (capped at NAME_MAX on the client), and this should be set in sbi->ll_namelen and returned by ll_statfs_internal().
I don't think that > 255-char filenames is a "problem" per-se, just that pjdfstest is depending on glibc and POSIX limits. That is really a problem in the test/spec in the end.
I was going to suggest to add osd-zfs and llite tunables to allow changing the os_namelen limit (and depend only on the client to do the truncation), but it appears that the Lustre code is using NAME_MAX all over the place (e.g. llite, lmv, lfsck, lod, mdd, mdt should use os_namelen, fscrypt and ext4-filename-encode.patch should use EXT4_NAME_MAX, etc.), so increasing this limit would be a much larger project than fixing this one issue, and should get its own Jira ticket.
"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/58336/
Subject:
LU-18783llite: ensure dentry name within ll_namelenProject: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 6210f4ae96633b95fc62c8fddc7d9517b5bb7e5c