Re: number of hardlinks for directory in ls -lid always 1?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 18, 2015 at 02:31:43PM +0100, Martin Steigerwald wrote:
> Am Dienstag, 17. März 2015, 17:07:17 schrieb David Sterba:
> > On Tue, Mar 17, 2015 at 02:33:30PM +0100, Martin Steigerwald wrote:
> > > On BTRFS I see
> > > 
> > > martin@merkaba:~> ls -lid /usr/local
> > > 27138 drwxrwsr-x 1 root staff 62 Aug 15  2014 /usr/local
> > > martin@merkaba:~> ls -lid /usr/local/.
> > > 27138 drwxrwsr-x 1 root staff 62 Aug 15  2014 /usr/local/.
> > > martin@merkaba:~> ls -lid /usr/local/bin/..
> > > 27138 drwxrwsr-x 1 root staff 62 Aug 15  2014 /usr/local/bin/..
> > > 
> > > On other filesystems like Ext4 I see the actual number of hardlinks to
> > > the directory.
> > > 
> > > Is this intended behaviour of BTRFS or a bug?
> > 
> > Intended behaviour, this has been asked in the past, I don't have the
> > link sorry, try searching the mailinglist archives.

http://thread.gmane.org/gmane.comp.file-systems.btrfs/14634

"Directories always have a link count of 1 in btrfs.  This tells find
not to use the link count as the count of subdirectories in the
directory."

http://thread.gmane.org/gmane.comp.file-systems.btrfs/29906

"As I understand it, inferring the number of directory entries from
st_nlink is an optimization that isn't universally valid. If that
count is 1, it must be considered invalid, and programs that don't
handle this correctly are broken.  Coreutils handle this, at least..."
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux