From: Amir Goldstein <amir73il@gmail.com>
To: dsterba@suse.cz, David Howells <dhowells@redhat.com>,
Linux Btrfs <linux-btrfs@vger.kernel.org>,
linux-xfs <linux-xfs@vger.kernel.org>,
Christoph Hellwig <hch@infradead.org>,
Amir Goldstein <amir73il@gmail.com>,
Dave Chinner <david@fromorbit.com>,
fstests <fstests@vger.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Eryu Guan <eguan@redhat.com>
Subject: Re: Does btrfs get nlink on directories wrong? -- was Re: [PATCH 2/4] xfstests: Add first statx test [ver #5]
Date: Wed, 5 Apr 2017 15:32:30 +0300 [thread overview]
Message-ID: <CAOQ4uxik1EbovazuEnMErR433Eh=Ls8h3LhQPEU2nJhigcR+Cw@mail.gmail.com> (raw)
In-Reply-To: <20170405123008.GB4781@twin.jikos.cz>
On Wed, Apr 5, 2017 at 3:30 PM, David Sterba <dsterba@suse.cz> wrote:
> On Wed, Apr 05, 2017 at 11:53:41AM +0100, David Howells wrote:
>> I've added a test to xfstests that exercises the new statx syscall. However,
>> it fails on btrfs:
>>
>> Test statx on a directory
>> +[!] stx_nlink differs, 1 != 2
>> +Failed
>> +stat_test failed
>>
>> because a new directory it creates has an nlink of 1, not 2. Is this a case
>> of my making an incorrect assumption or is it an fs bug?
>
> Afaik nlink == 1 means that there's no accounting of subdirectories, and
> it's a valid value. The 'find' utility can use nlink to optimize
> directory traversal but otherwise I'm not aware of other usage.
>
> All directories in btrfs have nlink == 1.
FYI,
Overlayfs uses nlink = 1 for merge dirs to silence 'find' et al.
Ext4 uses nlink = 1 for directories with more than 32K subdirs
(EXT4_FEATURE_RO_COMPAT_DIR_NLINK).
But in both those fs newly created directories will have nlink = 2.
next prev parent reply other threads:[~2017-04-05 12:32 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-04 15:55 [PATCH 1/4] xfstests: Add an auxiliary program to create an AF_UNIX socket [ver #5] David Howells
2017-04-04 15:55 ` [PATCH 2/4] xfstests: Add first statx test " David Howells
2017-04-05 10:38 ` Eryu Guan
2017-04-05 10:53 ` Does btrfs get nlink on directories wrong? -- was " David Howells
2017-04-05 12:30 ` David Sterba
2017-04-05 12:32 ` Amir Goldstein [this message]
2017-04-08 15:43 ` Eryu Guan
2017-04-08 21:02 ` David Howells
2017-04-04 15:55 ` [PATCH 3/4] xfstests: Partially expand the documentation " David Howells
2017-04-05 10:42 ` Eryu Guan
2017-04-05 10:55 ` David Howells
2017-04-05 10:59 ` Should xfstest generic/388 be using _require_command for fsstress? David Howells
2017-04-05 11:10 ` Eryu Guan
2017-04-05 11:17 ` David Howells
2017-04-05 11:32 ` Eryu Guan
2017-04-04 15:55 ` [PATCH 4/4] xfstests: Check the stx_attributes settable by chattr [ver #5] David Howells
2017-04-05 10:52 ` Eryu Guan
2017-04-05 11:11 ` David Howells
2017-04-05 11:30 ` Eryu Guan
2017-04-05 12:25 ` David Howells
2017-04-06 3:17 ` Eryu Guan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAOQ4uxik1EbovazuEnMErR433Eh=Ls8h3LhQPEU2nJhigcR+Cw@mail.gmail.com' \
--to=amir73il@gmail.com \
--cc=david@fromorbit.com \
--cc=dhowells@redhat.com \
--cc=dsterba@suse.cz \
--cc=eguan@redhat.com \
--cc=fstests@vger.kernel.org \
--cc=hch@infradead.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).