From: Andreas Dilger <adilger@clusterfs.com>
To: David Malone <dwmalone@maths.tcd.ie>
Cc: linux-xfs@oss.sgi.com, linux-kernel@vger.kernel.org
Subject: Re: Directory link count wrapping on Linux/XFS/i386?
Date: Wed, 30 Mar 2005 13:06:01 -0700 [thread overview]
Message-ID: <20050330200601.GG1753@schnapps.adilger.int> (raw)
In-Reply-To: <200503302043.aa27223@salmon.maths.tcd.ie>
[-- Attachment #1: Type: text/plain, Size: 1072 bytes --]
On Mar 30, 2005 20:43 +0100, David Malone wrote:
> It seems that internally xfs uses a 32 bit field for the link count,
> and the stat64 syscalls use a 32 bit field. These fields are copied
> via the vattr structure in xfs_vnode.h, which uses a nlink_t for
> the link count. However, in the kernel, I think this field is
> actually of type __kernel_nlink_t which seems to be 16 bits on many
> platforms.
>
> I've tested this on an i386 2.6.11 kernel and it seems that the
> link count presented to userland wraps after 65536 subdirectories.
> This naturally doesn't let you screw up the filesystem or anything,
> but it does let you can hide files from find/fts, as demonstrated
> below.
The correct fix, used for reiserfs (and a patch for ext3 also) is to
set i_nlink = 1 in case the filesystem count has wrapped. When nlink==1
the fts/find code no longer optimizes subdirectory traversal and checks
each entries filetype to see if it should recurse.
Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2005-03-30 20:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-30 19:43 Directory link count wrapping on Linux/XFS/i386? David Malone
2005-03-30 20:06 ` Andreas Dilger [this message]
2005-03-31 0:42 ` Nathan Scott
2005-03-31 2:25 ` Nathan Scott
2005-03-31 6:23 ` Jan Engelhardt
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=20050330200601.GG1753@schnapps.adilger.int \
--to=adilger@clusterfs.com \
--cc=dwmalone@maths.tcd.ie \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@oss.sgi.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.