All of lore.kernel.org
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: Marcelo Tosatti <marcelo@kvack.org>
Cc: Grant Coady <gcoady.lk@gmail.com>,
	linux-kernel@vger.kernel.org, Al Viro <viro@ftp.linux.org.uk>
Subject: Re: Linux 2.4.33-rc1
Date: Wed, 21 Jun 2006 22:26:30 +0200	[thread overview]
Message-ID: <20060621202630.GA16875@1wt.eu> (raw)
In-Reply-To: <20060621135015.GA620@dmt>

Hi Marcelo,

On Wed, Jun 21, 2006 at 10:50:15AM -0300, Marcelo Tosatti wrote:
> Hi Willy,
> 
> On Wed, Jun 21, 2006 at 12:23:57AM +0200, Willy Tarreau wrote:
> > On Mon, Jun 19, 2006 at 08:45:06PM -0300, Marcelo Tosatti wrote:
> > > > 
> > > > ---- from here ----
> > > > 
> > > > 
> > > > > +		inode = dentry->d_inode;
> > > > > +		if (inode)
> > > > > +			atomic_inc(&inode->i_count);
> > > > >  		error = vfs_unlink(nd.dentry->d_inode, dentry);
> > > > >  	exit2:
> > > > >  		dput(dentry);
> > > > >  	}
> > > > >  	up(&nd.dentry->d_inode->i_sem);
> > > > > +	if (inode)
> > > > > +		iput(inode);
> > > > 
> > > > ---- to here ----
> > > > 
> > > > I believe that nd.dentry->d_inode cannot vanish because it is protected by the
> > > > down(->i_sem) before and the up(->i_sem) after. Am I right or am I missing
> > > > something important ?
> > > 
> > > Indeed it can't, but dentry->d_inode will be set to NULL by
> > > nfs_unlink->nfs_safe_remove->d_delete. Thus the problem.
> > 
> > What puzzles me is how are we supposed to up(&nd.dentry->d_inode->i_sem) if
> > dentry->d_inode can become NULL ? 
> 
>         down(&nd.dentry->d_inode->i_sem);
>         dentry = lookup_hash(&nd.last, nd.dentry);
>         error = vfs_unlink(nd.dentry->d_inode, dentry);
> 					       ^^^^^^^
> 
> It does vfs_unlink(parent, child). The child is killed.
>
> > simply by keeping a copy of it ? I thought
> > that the down() protected the whole thing, but may be that's stupid anyway.
> 
> It does not protect from last reference going away, which is what
> happens when NFS d_delete's the dentry. dentry_iput() gets called, and
> maybe the last reference to "struct inode" might be gone too.

OK for this one, but what I mean is that vfs_unlink() will kill dentry
(its second argument, which your fix protects), while the down()/up()
we initially suspected, and tried to protect, play with nd.dentry->d_inode,
which is the directory in which we are removing dentry. And I can't see how
nd.dentry->d_inode can be killed during vfs_unlink(), reason why I thought
the fix above did not provide any benefit.

> > I've been running rc1 without this patch for a few hours and during kernel
> > compiles without a problem, so I'm not sure about what to think about the
> > other changes which were apparently harmless too :-/
> 
> Use NFS... :)

I'm using it at home right now, doing lots of git-checkout -f and make -j
dep ; make -j 4 bzImage modules on SMP without a glitch. Right now I'm
running rc2 without trouble and I noticed you did not merge the fix for
sys_unlink() that we discussed above. May be you simply have forgotten it
or may be we are in sync but were talking about different things.

> > Well, if I resume it right, we only need to merge your patch and mine and
> > it *should* be OK.
> > 
> > BTW, I've been reviewing the PaX patch and found *at least* one patch
> > that should be merged (fix for oops). I'll send it separately, and it's
> > queued in -upstream.
> 
> Merged, thanks.

Thanks,
Willy


  reply	other threads:[~2006-06-21 20:32 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-16 18:14 Linux 2.4.33-rc1 Marcelo Tosatti
2006-06-16 22:21 ` Grant Coady
2006-06-16 22:38   ` Michal Piotrowski
2006-06-16 23:24     ` Grant Coady
2006-06-17  5:13       ` Willy Tarreau
2006-06-17  6:24         ` Grant Coady
2006-06-17  7:10           ` Willy Tarreau
2006-06-17 17:15             ` Need to format twice /dev/ramX with reiserfs to be able to mount it ? sebastien cabaniols
2006-06-17 18:14               ` Bernd Eckenfels
2006-06-17 18:37                 ` sebastien cabaniols
2006-06-17 19:55             ` Linux 2.4.33-rc1 Marcelo Tosatti
2006-06-18 13:37   ` Marcelo Tosatti
2006-06-18 22:25     ` Grant Coady
2006-06-18 22:37       ` Willy Tarreau
2006-06-18 23:07         ` Grant Coady
2006-06-19  4:01           ` Willy Tarreau
2006-06-19  5:03             ` Grant Coady
2006-06-19  8:06               ` Willy Tarreau
2006-06-19  8:53                 ` Grant Coady
2006-06-19  9:08                   ` Willy Tarreau
2006-06-19  9:12                 ` Grant Coady
2006-06-19  9:24                   ` Willy Tarreau
2006-06-19 10:27                     ` Grant Coady
2006-06-19 10:31                       ` Willy Tarreau
2006-06-19 20:11                         ` Grant Coady
2006-06-19 20:20                           ` Willy Tarreau
2006-06-19 22:04                 ` Marcelo Tosatti
2006-06-19 23:00                   ` Willy Tarreau
2006-06-19 23:45                     ` Marcelo Tosatti
2006-06-20 22:23                       ` Willy Tarreau
2006-06-21  1:09                         ` Grant Coady
2006-06-21  4:05                           ` Willy Tarreau
2006-06-21 13:50                         ` Marcelo Tosatti
2006-06-21 20:26                           ` Willy Tarreau [this message]
2006-06-18 22:33     ` Grant Coady
2006-06-18 22:40       ` Willy Tarreau

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=20060621202630.GA16875@1wt.eu \
    --to=w@1wt.eu \
    --cc=gcoady.lk@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@kvack.org \
    --cc=viro@ftp.linux.org.uk \
    /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.