[Nix-dev] hitting maximum number of hard links on btrfs

Mathijs Kwik mathijs at bluescreen303.nl
Wed Oct 31 00:14:46 CET 2012


Hi all,

When I run nix-store --optimise, I recently got messages like this:
`/nix/store/.links/17zyaa88vkycdkas7b0zhc17jz6cz8ixrgvnh3bbp6b2ny60a8id'
has maximum number of links
`/nix/store/.links/01rljl4whpjz6l9301198gss4j55al5zngldhazm1an2zh117qxv'
has maximum number of links

stat'ing these showed they both had 315 links. Also, both files seemed
to contain some TeX binary stuff, which might be why they are so
heavily linked.

Googling a bit gave me:
http://nlug.ml1.co.uk/2012/05/btrfs-max-number-of-hardlinks-gotcha/3127

So btrfs has a soft limit, depending on file name/path length, which
only kicks in in this special situation where you have many hard links
to a file in the same directory.
Given nix's special behavior in /nix/store/.links, I think this is the problem.

Do I need to worry about this message?
As in, store corruptions? Inability to garbage-collect later on?
Or does this just mean I will have a few more duplicate files in store
that can't be duped?

Thanks,
Mathijs


More information about the nix-dev mailing list