All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] remove unneeded inode semaphores from driverfs
@ 2002-02-26  8:59 Andrey Panin
  2002-02-26  8:59 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Andrey Panin @ 2002-02-26  8:59 UTC (permalink / raw)
  To: mochel; +Cc: linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 474 bytes --]

Hi,

__remove_file() in driverfs/inode.c calls down(&dentry->d_inode->i_sem)
before calling vfs_unlink(dentry->d_parent->d_inode,dentry) which 
tries to claim the same semaphore causing the livelock.
driverfs_remove_dir() makes the same calling vfs_rmdir().

These bugs are triggered by driverfs for IDE patch by Pavel Machek.

Best regards.

-- 
Andrey Panin            | Embedded systems software engineer
pazke@orbita1.ru        | PGP key: wwwkeys.eu.pgp.net

[-- Attachment #1.2: patch-driverfs-sem --]
[-- Type: text/plain, Size: 963 bytes --]

diff -urN -X /usr/share/dontdiff /linux.vanilla/fs/driverfs/inode.c /linux/fs/driverfs/inode.c
--- /linux.vanilla/fs/driverfs/inode.c	Sun Feb 17 15:15:57 2002
+++ /linux/fs/driverfs/inode.c	Sat Feb 23 22:42:38 2002
@@ -698,11 +698,9 @@
 static void __remove_file(struct dentry * dentry)
 {
 	dget(dentry);
-	down(&dentry->d_inode->i_sem);
 
 	vfs_unlink(dentry->d_parent->d_inode,dentry);
 
-	up(&dentry->d_inode->i_sem);
 	dput(dentry);
 
 	/* remove reference count from when file was created */
@@ -766,7 +764,6 @@
 	dentry = dget(dir->dentry);
 	dget(dentry->d_parent);
 	down(&dentry->d_parent->d_inode->i_sem);
-	down(&dentry->d_inode->i_sem);
 
 	node = dir->files.next;
 	while (node != &dir->files) {
@@ -782,7 +779,6 @@
 
 	vfs_rmdir(dentry->d_parent->d_inode,dentry);
 	up(&dentry->d_parent->d_inode->i_sem);
-	up(&dentry->d_inode->i_sem);
 
 	/* remove reference count from when directory was created */
 	dput(dentry);

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] remove unneeded inode semaphores from driverfs
  2002-02-26  8:59 [PATCH] remove unneeded inode semaphores from driverfs Andrey Panin
@ 2002-02-26  8:59 ` Greg KH
  2002-02-26 10:12   ` Andrey Panin
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2002-02-26  8:59 UTC (permalink / raw)
  To: mochel, linux-kernel

On Tue, Feb 26, 2002 at 11:59:46AM +0300, Andrey Panin wrote:
> Hi,
> 
> __remove_file() in driverfs/inode.c calls down(&dentry->d_inode->i_sem)
> before calling vfs_unlink(dentry->d_parent->d_inode,dentry) which 
> tries to claim the same semaphore causing the livelock.
> driverfs_remove_dir() makes the same calling vfs_rmdir().

What kernel version did you generate this patch for?  This patch doesn't
apply at all to 2.5.5, and it looks like this problem is already fixed.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] remove unneeded inode semaphores from driverfs
  2002-02-26  8:59 ` Greg KH
@ 2002-02-26 10:12   ` Andrey Panin
  2002-02-26 16:53     ` Patrick Mochel
  0 siblings, 1 reply; 4+ messages in thread
From: Andrey Panin @ 2002-02-26 10:12 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 784 bytes --]

On Tue, Feb 26, 2002 at 12:59:53AM -0800, Greg KH wrote:
> On Tue, Feb 26, 2002 at 11:59:46AM +0300, Andrey Panin wrote:
> > Hi,
> > 
> > __remove_file() in driverfs/inode.c calls down(&dentry->d_inode->i_sem)
> > before calling vfs_unlink(dentry->d_parent->d_inode,dentry) which 
> > tries to claim the same semaphore causing the livelock.
> > driverfs_remove_dir() makes the same calling vfs_rmdir().
> 
> What kernel version did you generate this patch for?  This patch doesn't
> apply at all to 2.5.5, and it looks like this problem is already fixed.

It's against 2.5.5-pre1, I was out of the net for some days and
couldn't check final 2.5.5.

-- 
Andrey Panin            | Embedded systems software engineer
pazke@orbita1.ru        | PGP key: wwwkeys.eu.pgp.net

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] remove unneeded inode semaphores from driverfs
  2002-02-26 10:12   ` Andrey Panin
@ 2002-02-26 16:53     ` Patrick Mochel
  0 siblings, 0 replies; 4+ messages in thread
From: Patrick Mochel @ 2002-02-26 16:53 UTC (permalink / raw)
  To: Andrey Panin; +Cc: Greg KH, linux-kernel


On Tue, 26 Feb 2002, Andrey Panin wrote:

> On Tue, Feb 26, 2002 at 12:59:53AM -0800, Greg KH wrote:
> > On Tue, Feb 26, 2002 at 11:59:46AM +0300, Andrey Panin wrote:
> > > Hi,
> > > 
> > > __remove_file() in driverfs/inode.c calls down(&dentry->d_inode->i_sem)
> > > before calling vfs_unlink(dentry->d_parent->d_inode,dentry) which 
> > > tries to claim the same semaphore causing the livelock.
> > > driverfs_remove_dir() makes the same calling vfs_rmdir().
> > 
> > What kernel version did you generate this patch for?  This patch doesn't
> > apply at all to 2.5.5, and it looks like this problem is already fixed.
> 
> It's against 2.5.5-pre1, I was out of the net for some days and
> couldn't check final 2.5.5.

>From the changelog, it is only the mysterious "device model/driverfs 
updates", but it should have indeed been fixed in 2.5.5.

Thanks,

	-pat


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-02-26 16:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-26  8:59 [PATCH] remove unneeded inode semaphores from driverfs Andrey Panin
2002-02-26  8:59 ` Greg KH
2002-02-26 10:12   ` Andrey Panin
2002-02-26 16:53     ` Patrick Mochel

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.