public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 1/2] xfs: clear inode per-lifetime state when recycling it
Date: Thu, 2 Jun 2011 10:16:24 +1000	[thread overview]
Message-ID: <20110602001624.GM561@dastard> (raw)
In-Reply-To: <20110531200950.GA31713@infradead.org>

On Tue, May 31, 2011 at 04:09:50PM -0400, Christoph Hellwig wrote:
> Looks good.
> 
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> 
> > +		 * XXX(dgc): should the XFS_ISTALE flag only be cleared here?
> 
> I think so.  Right now any iget on a stale inode will clear it, which
> is very wrong.  Care to send a separate patch for that?

However, the di_mode has already been set to zero before it is
marked stale, so any lookup on it without the XFS_IGET_CREATE flag
set will fail. And only inode allocation sets that flag, in which
case we want the XFS_ISTALE flag cleared. We can't have a race with
the XFS_ISTALE flag being set (both inode freeing and allocation
requires the AGI lock), so once it is stale it is protected by the
mode/flag check.

So it seems safe where it is, but it's not exactly obvious why.

Hmmmm. The inode_init_always() failure case does not clear the
XFS_IRECLAIM flag - that seems like a bug as it will prevent the
inode from ever being reclaimed. Indeed, the error handling looks
completely broken - it's like it is assuming the inode has already
been removed from the reclaim list and marked XFS_INEW. Oh, it used
to do exactly that before this commmit:


commit f1f724e4b523d444c5a598d74505aefa3d6844d2
Author: Christoph Hellwig <hch@infradead.org>
Date:   Mon Mar 1 11:30:31 2010 +0000

    xfs: fix locking for inode cache radix tree tag updates

    The radix-tree code requires it's users to serialize tag updates
    against other updates to the tree.  While XFS protects tag updates
    against each other it does not serialize them against updates of the
    tree contents, which can lead to tag corruption.  Fix the inode
    cache to always take pag_ici_lock in exclusive mode when updating
    radix tree tags.

    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Reported-by: Patrick Schreurs <patrick@news-service.com>
    Tested-by: Patrick Schreurs <patrick@news-service.com>
    Signed-off-by: Alex Elder <aelder@sgi.com>

So yes, it needs fixing.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2011-06-02  0:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-31  4:20 [PATCH 0/2] xfs: couple of fixes for 3.0-rc2 Dave Chinner
2011-05-31  4:20 ` [PATCH 1/2] xfs: clear inode per-lifetime state when recycling it Dave Chinner
2011-05-31 20:09   ` Christoph Hellwig
2011-06-02  0:16     ` Dave Chinner [this message]
2011-05-31 22:19   ` Alex Elder
2011-05-31  4:20 ` [PATCH 2/2] xfs: prevent bogus assert when trying to remove non-existent attribute Dave Chinner
2011-05-31 20:10   ` Christoph Hellwig
2011-05-31 22:19   ` Alex Elder

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=20110602001624.GM561@dastard \
    --to=david@fromorbit.com \
    --cc=hch@infradead.org \
    --cc=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