Description of problem: When using 'ls -l' command on the btrfs filesystem, it outputs 1 as the number of hardlinks for every directory, no matter how its content looks like. Other filesystems seem to be ok. Version-Release number of selected component (if applicable): coreutils-8.12-7.fc16.i686 How reproducible: 100 % Steps to Reproduce: 1. create a directory on the btrfs filesystem and create a subdirectory in it 2. run 'ls -ld' on the toplevel directory 3. see that there is 1 on the place of the number of hardlinks Actual results: although there is a subdirectory in the toplevel directory, the number of hardlinks is 1 Expected results: number of hardlinks is 2, because 'toplevel_dir/subdir/..' is the a link to the toplevel directory Additional info: I hope this is not an expected behaviour on the btrfs. Please reassing this bug to kernel if this is a btrfs bug.
When other filesystems are ok, it is most probably filesystem issue. Reassigning to kernel and Josef Bacik.
http://permalink.gmane.org/gmane.comp.file-systems.btrfs/4588
> I hope this is not an expected behaviour on the btrfs. It is. In addition to the previous comment with the link to a discussion about this, here's a link to the thread where the upstream maintainer rejects patches to track nlink in directories: http://comments.gmane.org/gmane.comp.file-systems.btrfs/4583 Arguably btrfs could behave like ext4 and track the link count until it hits a max and then goes to 1, but that's a discussion to have upstream. This isn't a bug in Fedora.