100% reproducible filesystem corruption after reboot with hard links in /tmp

Number:rdar://19687545 Date Originated:2/2/15
Status:Open Resolved:
Product:OS X Product Version:10.10.2
Classification:Crash/Hang/Data Loss Reproducible:Always
We have found a reproducible case where Disk Utility reports filesystem corruption. See https://github.com/fish-shell/fish-shell/issues/1859 for our discussion.

Specifically, if you have a socket under /tmp, and a hard link to that socket also under /tmp, upon reboot, Disk Utility reports disk errors: "Incorrect number of file hard links"

Steps to Reproduce:
1. Run the following on the commandline: nc -Ul /tmp/foo &; ln /tmp/foo /tmp/bar
2. Reboot
3. Use Disk Utility to "Verify Disk"

Expected Results:
No disk errors

Actual Results:
Disk Utility reports "Invalid number of hard links" and requires repair. To fix this, it is necessary to boot into another volume (or with Command-R) and use Disk Utility to repair the affected disk.

Reproduces on 10.10.0 and 10.10.2


Journaled HFS+ (case insensitive), 10.10.0 and 10.10.2


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!