linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* fix fs->lock deadlock
@ 2003-04-16 17:43 David Mosberger
  0 siblings, 0 replies; only message in thread
From: David Mosberger @ 2003-04-16 17:43 UTC (permalink / raw)
  To: torvalds, akpm; +Cc: linux-kernel

The patch below is needed to avoid a deadlock on fs->lock.  Without
the patch, if __emul_lookup_dentry() returns 0, we fail to reacquire
current->fs->lock and then go ahead to read_unlock() it anyhow.  Bad
for your health.

I believe the bug was introduced by this change set (about 9 weeks ago):

  http://linux.bkbits.net:8080/linux-2.5/diffs/fs/namei.c@1.63.1.2

	--david

===== fs/namei.c 1.69 vs edited =====
--- 1.69/fs/namei.c	Wed Apr  2 22:51:31 2003
+++ edited/fs/namei.c	Wed Apr 16 10:18:40 2003
@@ -847,6 +847,7 @@
 			read_unlock(&current->fs->lock);
 			if (__emul_lookup_dentry(name,nd))
 				return 0;
+			read_lock(&current->fs->lock);
 		}
 		nd->mnt = mntget(current->fs->rootmnt);
 		nd->dentry = dget(current->fs->root);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-16 17:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-16 17:43 fix fs->lock deadlock David Mosberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).