linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: David Chinner <dgc@sgi.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: Race between generic_forget_inode() and sync_sb_inodes()?
Date: Fri, 30 Nov 2007 10:03:47 +1100	[thread overview]
Message-ID: <18255.17747.484721.210728@notabene.brown> (raw)
In-Reply-To: message from David Chinner on Friday November 30

On Friday November 30, dgc@sgi.com wrote:
> On Fri, Nov 30, 2007 at 09:07:06AM +1100, Neil Brown wrote:
> > 
> > Hi David,
> > 
> > On Friday November 30, dgc@sgi.com wrote:
> > > 
> > > 
> > > I came across this because I've been making changes to XFS to avoid the
> > > inode hash, and I've found that I need to remove the inode from the
> > > dirty list when setting I_WILL_FREE to avoid this race. I can't see
> > > how this race is avoided when inodes are hashed, so I'm wondering
> > > if we've just been lucky or there's something that I'm missing that
> > > means the above does not occur.
> > 
> > Looking at inode.c in 2.6.23-mm1, in generic_forget_inode, I see code:
> > 
> > 	if (!hlist_unhashed(&inode->i_hash)) {
> > 		if (!(inode->i_state & (I_DIRTY|I_SYNC)))
> > 			list_move(&inode->i_list, &inode_unused);
> > 
> > so it looks to me like:
> >    If the inode is hashed and dirty, then move it (off the s_dirty
> >    list) to inode_unused.
> 
> That check is for if the inode is _not_ dirty or being sync, right?
> Or have I just not had enough coffee this morning?

:-)  And I cannot even blame the lack of coffee as I don't drink it.

My second guess is that we have been lucky.... which is hard to believe.

I wonder if iput (and even iget) should BUG on I_WILL_FREE as well...

Perplexed.

NeilBrown

  reply	other threads:[~2007-11-29 23:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-29 21:55 Race between generic_forget_inode() and sync_sb_inodes()? David Chinner
2007-11-29 22:07 ` Neil Brown
2007-11-29 22:24   ` David Chinner
2007-11-29 23:03     ` Neil Brown [this message]
2007-11-30  9:41       ` Jarek Poplawski

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=18255.17747.484721.210728@notabene.brown \
    --to=neilb@suse.de \
    --cc=dgc@sgi.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).