zfs and st_nlink limit at 32767
Don Lewis
truckman at FreeBSD.org
Sat Mar 5 23:16:31 UTC 2016
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.
More information about the freebsd-fs
mailing list