zfs and st_nlink limit at 32767

Nagy, Attila bra at fsn.hu
Mon Mar 7 08:21:15 UTC 2016


Hi,

On 03/06/16 00:16, Don Lewis wrote:
> On  5 Mar, Steven Hartland wrote:
>> Correct stat st_nlink is a nlink_t which is defined as uint16_t, its not
>> clear why its clamping at what looks like int16_t max.
>>
>> It looks like the kernel version in nstat is a uint32_t so internally it
>> should be correct.
>>
>> You may have some joy changing it to uint32_t but is likely everything
>> will rebuilding and even then there may be some edge cases which break
>> one that sticks out is linux compat support which doesn't use nlink_t.
> Yeah, changing it would change the stat() ABI, so you would have to
> recompile everything that calls stat().  Also the syscall would have to
> be versioned so that executables built on previous FreeBSD versions
> would still get the old version of struct stat.
>
> Something else to look out for is archive formats.  It's possible that
> nlinks is embedded in them.  Breaking the ability to read your old
> backup tapes would be a real bummer.
In the hope that somebody will eventually resolve this, I've filed a bug 
report:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207763


More information about the freebsd-fs mailing list