public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Cliff Wickman <cpw@sgi.com>
To: Bharata B Rao <bharata@in.ibm.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Very rare crash in prune_dcache
Date: Tue, 20 Dec 2005 07:33:41 -0600	[thread overview]
Message-ID: <20051220133341.GA9329@sgi.com> (raw)
In-Reply-To: <20051220064629.GA31099@in.ibm.com>

Hi Bharata,

On Tue, Dec 20, 2005 at 12:16:29PM +0530, Bharata B Rao wrote:
> Hi Cliff,
> 
> > I suspect a race condition inside prune_dcache().
> > 
> > The prune_dcache() function:
> >         lock dcache_lock
> >         scan the dentry_unused list of dentry's for a given number ("count") of
> >         dentry's to free:
                    --------
                    get (remove) dentry from dentry_unused list
                    --------
> >                 if a dentry to free, call prune_one_dentry()
> >                         dentry_iput()
> >                                 unlock dcache_lock
> >                                 iput() any associated inode
> >                         d_free() the dentry
> >                         lock dcache_lock
> >         unlock dcache_lock
> > 
> > Two processors entering prune_dcache() near the same time will both scan
> > the dentry_unused list and could try to iput() the same inode twice.  That is
> > because the dcache_lock is released while running iput().
>
> Isn't this what dcache_lock doing presently ? As per vanilla 2.6.5 kernel
> I don't see how the race condition you mention above can happen.
> 
> In prune_dcache(), a dentry is first removed off the dentry_unused list
> (under dcache_lock) before calling prune_one_dentry(). So how is it 
> possible that an another thread executing prune_dcache() will hit
> the same dentry again ?

Yes, I think you're right.   And it's not theoretically possible for
two dentry's to point to the same inode.  So the inode that caused our
crash must have been corrupted elsewhere.
Thanks.

-Cliff

-- 
Cliff Wickman
Silicon Graphics, Inc.
cpw@sgi.com
(651) 683-3824

      reply	other threads:[~2005-12-20 13:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-19 21:38 Very rare crash in prune_dcache John F Flynn III
2005-12-19 22:34 ` Cliff Wickman
2005-12-20  6:46   ` Bharata B Rao
2005-12-20 13:33     ` Cliff Wickman [this message]

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=20051220133341.GA9329@sgi.com \
    --to=cpw@sgi.com \
    --cc=bharata@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    /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