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

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.