The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Nathan Scott <nathans@sgi.com>
To: David Malone <dwmalone@maths.tcd.ie>,
	linux-xfs@oss.sgi.com, linux-kernel@vger.kernel.org
Subject: Re: Directory link count wrapping on Linux/XFS/i386?
Date: Thu, 31 Mar 2005 10:42:58 +1000	[thread overview]
Message-ID: <20050331004258.GF867@frodo> (raw)
In-Reply-To: <20050330200601.GG1753@schnapps.adilger.int>

On Wed, Mar 30, 2005 at 01:06:01PM -0700, Andreas Dilger wrote:
> 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.

Yes, use of nlink_t looks wrong there, thanks.  Theres one/two other
uses of it in XFS as well, I'll audit those.

> 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.

Ah, I see - the INC_DIR_INODE_NLINK/DEC_DIR_INODE_NLINK macros, right.
I'll look into that too, thanks.

cheers.

-- 
Nathan

  reply	other threads:[~2005-03-31  0:48 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
2005-03-31  0:42   ` Nathan Scott [this message]
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=20050331004258.GF867@frodo \
    --to=nathans@sgi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox