From: Dave Chinner <david@fromorbit.com>
To: Lachlan McIlroy <lachlan@sgi.com>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH] Re: another problem with latest code drops
Date: Mon, 20 Oct 2008 17:05:22 +1100 [thread overview]
Message-ID: <20081020060522.GP31761@disturbed> (raw)
In-Reply-To: <20081020052929.GN31761@disturbed>
On Mon, Oct 20, 2008 at 04:29:29PM +1100, Dave Chinner wrote:
> On Mon, Oct 20, 2008 at 02:37:42PM +1000, Lachlan McIlroy wrote:
> > Dave Chinner wrote:
> >> On Mon, Oct 20, 2008 at 12:37:13PM +1000, Lachlan McIlroy wrote:
> >>> I also hit this panic where we have taken a reference on an inode
> >>> that has I_CLEAR set. I suspect we've made it into xfs_iget_cache_hit()
> >>
> >> I don't think there is an iput() in that path. The only iput() call
> >> should be the IRELE() I added to xfs_iget_cache_miss(). Can you make
> >> sure the compiler is not inlining functions so we can pin-point
> >> where the iput() call is coming from? (i.e. static > STATIC on the
> >> hit/miss functions)
> > Just disassembled xfs_iget() and xfs_iget_cache_miss() has been inlined
> > and we're calling the IRELE() at the end of that function.
>
> Ok, that makes more sense.
>
> >>> and found an inode with XFS_IRECLAIMABLE set and since we don't call
> >>> igrab() we don't do the I_CLEAR check.
> >>
> >> In that case, we call inode_init_always() instead which sets the
> >> state to I_NEW and the reference count to 1. In the error case,
> >> the inode will have already been freed and we make
> > We don't set inode->i_state to i_NEW. We're stuffing XFS_INEW into
> > the XFS inode's i_flags field and not removing the I_CLEAR from the
> > linux inode. Note that inode_init_always() doesn't touch i_state.
>
> Yeah, xfs_setup_inode() is what is doing:
>
> inode->i_state = I_NEW|I_LOCK;
>
> which happens after the cache miss has been processed.
>
> Ok, so the initialisation code needs to clear іnode->i_state
> during allocation so that iput() does not complain. The i_state
> field is not accessed by anything until the inode is inserted
> into the superblock lists, so it should be safe to zero it
> in xfs_inode_alloc(). I missed that new_inode() returns an
> inode with a zeroed i_state....
On second thoughts, the inode has not been set up properly
by this stage, so we can't really even expect to be able to
call iput() on it. Hmmmm - maybe the only thing we can do
here is call security_inode_free() before xfs_idestroy.
Christoph - any opinions on what the best thing to do is?
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2008-10-20 6:03 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-16 2:06 another problem with latest code drops Lachlan McIlroy
2008-10-16 6:02 ` Dave Chinner
2008-10-16 7:38 ` Lachlan McIlroy
2008-10-16 7:20 ` Dave Chinner
2008-10-16 8:35 ` Lachlan McIlroy
2008-10-16 9:08 ` Christoph Hellwig
2008-10-17 1:13 ` Lachlan McIlroy
2008-10-16 22:29 ` Dave Chinner
2008-10-17 1:17 ` Lachlan McIlroy
2008-10-17 1:21 ` Dave Chinner
2008-10-17 2:04 ` [PATCH] " Dave Chinner
2008-10-17 2:07 ` Dave Chinner
2008-10-20 2:37 ` Lachlan McIlroy
2008-10-20 3:17 ` Dave Chinner
2008-10-20 4:37 ` Lachlan McIlroy
2008-10-20 5:29 ` Dave Chinner
2008-10-20 6:05 ` Dave Chinner [this message]
2008-10-20 21:41 ` Christoph Hellwig
2008-10-17 3:14 ` Lachlan McIlroy
2008-10-19 9:10 ` Christoph Hellwig
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=20081020060522.GP31761@disturbed \
--to=david@fromorbit.com \
--cc=lachlan@sgi.com \
--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 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.