Re: Linux 2.4.33-rc1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 18 Jun 2006 10:37:18 -0300, Marcelo Tosatti <[email protected]> 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).

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux