You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Ubuntu 25.10 / Mole CLI (Linux) 0.6.0: Home counts cross-directory hard links twice #2013
Mole CLI (Linux) 0.6.0, current linux@4de579cc3de36063880ab3e53e5af2587d2bfca9.
Ubuntu 25.10, aarch64, ordinary user in an OrbStack VM.
Reproduced with both uutils du 0.2.2 and GNU du 9.5.
Reproduction
Use a temporary HOME so no real user files are involved:
fixture=$(mktemp -d)
mkdir -p "$fixture/Documents""$fixture/Projects"
dd if=/dev/zero of="$fixture/Documents/original.bin" bs=1048576 count=1 status=none
ln "$fixture/Documents/original.bin""$fixture/Projects/linked.bin"
HOME="$fixture" mo analyze --json
# Inspect the entry whose name is Home.
The Home entry reports 2097152 bytes, although the two names refer to one 1 MiB file. One GNU du -skP --exclude=.cache "$fixture" reports 1024 KiB. The equivalent unchanged Analyze binary, built from the exact source above and run with --json on Linux, produced this Home row (temporary path omitted):
A focused test through measureOverviewSize and the Home JSON pipeline reports the same 2097152 B with either du implementation. The ordinary directory scanner's non-.cache entries total 1048576 B for the same links. The test used real hard links, with the production scanner unchanged.
Cause and scope
getDirectorySizeFromDuSkippingImmediateChild omits the immediate ~/.cache, then launches an independent du for each remaining child. Each process has its own hardlink set. A link directly in Home and another under a child has the same problem because direct files are added separately.
The deduplication needs to span the whole included Home measurement while still excluding only the immediate .cache, preserving nested caches and the Linux mount/snapshot rules. This differs from the Windows NTFS issue #2011/#2012. I am investigating the corresponding macOS Home path separately; this report concerns the Linux consumer.
The current Linux CONTRIBUTING.md asks for issues rather than PRs, so this is a reproduction report. No cleanup or real authorization was performed. AI assistance was used for the investigation and verification.
@r266-tech Thanks for the clean reproduction with both du builds. This is fixed on the linux branch: the Home row now counts a file once when its hard links sit in different children or directly in Home, and nested .cache folders are still counted.
Linux does it differently from #2014. uutils du 0.2.2 still counts links once per operand even inside one du -c, so the Linux CLI runs a single du over Home and leaves out only the literal ~/.cache path. Older cached Home totals are discarded.
It is in Nightly now and will be in the next Linux release:
Activity
fix(analyze): count Home hard links across children once (#2013)
docs(sync): point the Home hardlink record at #2014's merge and the L…
tw93 commentedon Nov 16, 2026
@r266-tech Thanks for the clean reproduction with both du builds. This is fixed on the
linuxbranch: the Home row now counts a file once when its hard links sit in different children or directly in Home, and nested.cachefolders are still counted.Linux does it differently from #2014. uutils du 0.2.2 still counts links once per operand even inside one
du -c, so the Linux CLI runs a single du over Home and leaves out only the literal~/.cachepath. Older cached Home totals are discarded.It is in Nightly now and will be in the next Linux release: