mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrey Panin <pazke@orbita1.ru>
To: mochel@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] remove unneeded inode semaphores from driverfs
Date: Tue, 26 Feb 2002 11:59:46 +0300	[thread overview]
Message-ID: <20020226085946.GB278@pazke.ipt> (raw)


[-- 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 --]

             reply	other threads:[~2002-02-26  8:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-26  8:59 Andrey Panin [this message]
2002-02-26  8:59 ` Greg KH
2002-02-26 10:12   ` Andrey Panin
2002-02-26 16:53     ` Patrick Mochel

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=20020226085946.GB278@pazke.ipt \
    --to=pazke@orbita1.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@osdl.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®