Re: Linux 2.4.33-rc1

From: Willy Tarreau
Date: Sun Jun 18 2006 - 18:39:39 EST


On Mon, Jun 19, 2006 at 08:33:19AM +1000, Grant Coady wrote:
> On Sun, 18 Jun 2006 10:37:18 -0300, Marcelo Tosatti <marcelo@xxxxxxxxx> wrote:
>
> >Can you please try the attached patch.
> >
> >Grab a reference to the victim inode before calling vfs_unlink() to avoid
> >it vanishing under us.
> >
> >diff --git a/fs/namei.c b/fs/namei.c
> >index 42cce98..7993283 100644
> >--- a/fs/namei.c
> >+++ b/fs/namei.c
> >@@ -1509,6 +1509,7 @@ asmlinkage long sys_unlink(const char *
> > char * name;
> > struct dentry *dentry;
> > struct nameidata nd;
> >+ struct inode *inode = NULL;
> >
> > name = getname(pathname);
> > if(IS_ERR(name))
> >@@ -1527,11 +1528,16 @@ asmlinkage long sys_unlink(const char *
> > /* Why not before? Because we want correct error value */
> > if (nd.last.name[nd.last.len])
> > goto slashes;
> >+ 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);
> > exit1:
> > path_release(&nd);
> > exit:
>
> An odd thing happening is that after editing /etc/lilo.conf I get the
> vim backup file: "/etc/lilo.co~" instead of "/etc/lilo.conf~" -- this
> was happening before the above patch, with -rc1. Very weird. I'm
> editing lilo.conf to have the box reboot to 2.6.16.20, since it is
> semi-headless (has KVM, but I usually it run via ssh terminal).

OK, if you doubt about the kernel you're running, the build # and date are
reported by 'uname -a'. I often abuse this because sometimes I'm not sure
about what I see !

> Grant.

Cheers,
Willy

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/