All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Jakob Oestergaard <jakob@unthought.net>, Phil Dier <phil@dier.us>,
	linux-kernel@vger.kernel.org, Scott Holdren <scott@icglink.com>,
	ziggy <ziggy@icglink.com>, Jack Massari <webmaster@icglink.com>
Subject: Re: oops with dual xeon 2.8ghz  4gb ram +smp, software raid, lvm, and xfs
Date: Tue, 23 Nov 2004 22:39:35 +0000	[thread overview]
Message-ID: <20041123223935.GA1889@infradead.org> (raw)
In-Reply-To: <20041123170222.GS4469@unthought.net>

On Tue, Nov 23, 2004 at 06:02:23PM +0100, Jakob Oestergaard wrote:
> With SMP, what I see is that sometimes a directory might decide that
> it's a file - but I can't delete it, becuase it isn't 'empty' (it's
> still somehow a directory).  Waiting a day or two, the system will
> change its mind back to letting the directory be a directory. Sometimes
> modes will be fscked up as well - a regular file can change owner, or it
> can change modes from '-rw-rw---' to '?---------'.    Weird stuff, no
> way to reproduce it reliably.

Actually I can reproduce it reliably by running nfs_fsstress.sh for a
looong time.  The problem is that in the current XFS code the inode
generation counter starts at 0, but higher level code uses that as
a wildcard for any possible generation, so you may get a newly created
file for a stale nfs file handler of an deleted file with the same inode
number.

The patch below fixes it for me:


Index: fs/xfs/xfs_inode.c
===================================================================
RCS file: /cvs/linux-2.6-xfs/fs/xfs/xfs_inode.c,v
retrieving revision 1.406
diff -u -p -r1.406 xfs_inode.c
--- fs/xfs/xfs_inode.c	27 Oct 2004 12:06:24 -0000	1.406
+++ fs/xfs/xfs_inode.c	23 Nov 2004 20:40:56 -0000
@@ -1224,9 +1224,16 @@ xfs_ialloc(
 	ip->i_d.di_nextents = 0;
 	ASSERT(ip->i_d.di_nblocks == 0);
 	xfs_ichgtime(ip, XFS_ICHGTIME_CHG|XFS_ICHGTIME_ACC|XFS_ICHGTIME_MOD);
+
 	/*
-	 * di_gen will have been taken care of in xfs_iread.
+	 * Bump the generation count so no one will confuse us with an
+	 * earlier incarnations of this inode.
+	 *
+	 * Done early to skip generation 0, which is used as a wildcard
+	 * by higher level code.
 	 */
+	ip->i_d.di_gen++;
+
 	ip->i_d.di_extsize = 0;
 	ip->i_d.di_dmevmask = 0;
 	ip->i_d.di_dmstate = 0;
@@ -2370,11 +2377,6 @@ xfs_ifree(
 		XFS_IFORK_DSIZE(ip) / (uint)sizeof(xfs_bmbt_rec_t);
 	ip->i_d.di_format = XFS_DINODE_FMT_EXTENTS;
 	ip->i_d.di_aformat = XFS_DINODE_FMT_EXTENTS;
-	/*
-	 * Bump the generation count so no one will be confused
-	 * by reincarnations of this inode.
-	 */
-	ip->i_d.di_gen++;
 	xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
 
 	if (delete) {

  parent reply	other threads:[~2004-11-23 22:43 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-22 19:06 oops with dual xeon 2.8ghz 4gb ram +smp, software raid, lvm, and xfs Phil Dier
2004-11-23  0:17 ` Andrew Morton
2004-11-23 15:37   ` Phil Dier
2004-11-23 17:02     ` Jakob Oestergaard
2004-11-23 18:29       ` Phil Dier
2004-11-23 22:39       ` Christoph Hellwig [this message]
2004-11-23 22:56         ` Jakob Oestergaard
2004-11-23 23:12           ` Christoph Hellwig
2004-11-30 17:37         ` Phil Dier
2004-11-24 15:45   ` Phil Dier
2004-11-24 16:56     ` Christoph Hellwig
2004-11-24 23:12     ` Andrew Morton
2004-11-25  0:48       ` Phil Dier
2004-11-28 11:29       ` David Greaves
2004-11-28 18:27         ` Andrew Morton
2004-12-08  9:03           ` David Greaves
2004-12-08  9:15             ` Andrew Morton
2004-12-09  3:50               ` Nigel Cunningham
2004-11-24 23:12   ` Neil Brown
2004-11-24 23:50     ` Andrew Morton
2004-11-25  0:14       ` Neil Brown
2004-11-25  1:05         ` Andrew Morton
2004-11-25  6:57         ` Jens Axboe
2004-11-25  7:08           ` Andrew Morton
2004-11-25  7:11             ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2004-11-23 20:48 Joerg Sommrey
2004-11-24  9:28 Anders Saaby
     [not found] <33rTj-1VZ-13@gated-at.bofh.it>
     [not found] ` <33wJq-633-25@gated-at.bofh.it>
     [not found]   ` <34fwL-P1-21@gated-at.bofh.it>
     [not found]     ` <34fGp-V2-9@gated-at.bofh.it>
     [not found]       ` <34fGp-V2-7@gated-at.bofh.it>
     [not found]         ` <34lVr-5WH-1@gated-at.bofh.it>
     [not found]           ` <34m5a-61Z-9@gated-at.bofh.it>
2004-11-25 11:07             ` Andi Kleen

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=20041123223935.GA1889@infradead.org \
    --to=hch@infradead.org \
    --cc=jakob@unthought.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phil@dier.us \
    --cc=scott@icglink.com \
    --cc=webmaster@icglink.com \
    --cc=ziggy@icglink.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.