All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] First casuality of hlist poisoning in 2.5.70
@ 2003-06-11 23:34 Trond Myklebust
  2003-06-11 23:50 ` Linus Torvalds
  2003-06-12  5:22 ` Linus Torvalds
  0 siblings, 2 replies; 9+ messages in thread
From: Trond Myklebust @ 2003-06-11 23:34 UTC (permalink / raw)
  To: Linus Torvalds, Alexander Viro; +Cc: Linux Kernel


Hi,

  This patch removes the Oops that occurs when either the source or
the target of a d_move() operation is unhashed. It is currently
triggered by the NFS sillyrename code.

Cheers,
  Trond

--- linux-2.5.70-up/fs/dcache.c.orig	2003-06-07 10:17:01.000000000 -0700
+++ linux-2.5.70-up/fs/dcache.c	2003-06-11 16:11:56.000000000 -0700
@@ -1223,8 +1223,13 @@
 	/* Move the dentry to the target hash queue, if on different bucket */
 	if (dentry->d_bucket != target->d_bucket) {
 		dentry->d_bucket = target->d_bucket;
-		hlist_del_rcu(&dentry->d_hash);
-		hlist_add_head_rcu(&dentry->d_hash, target->d_bucket);
+		if (!hlist_unhashed(&dentry->d_hash))
+			hlist_del_rcu(&dentry->d_hash);
+		if (!hlist_unhashed(&target->d_hash)) {
+			hlist_add_head_rcu(&dentry->d_hash, target->d_bucket);
+			dentry->d_vfs_flags &= ~DCACHE_UNHASHED;
+		} else
+			dentry->d_vfs_flags |= DCACHE_UNHASHED;
 	}
 
 	/* Unhash the target: dput() will then get rid of it */

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

end of thread, other threads:[~2003-06-19 23:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-11 23:34 [PATCH] First casuality of hlist poisoning in 2.5.70 Trond Myklebust
2003-06-11 23:50 ` Linus Torvalds
2003-06-12  0:04   ` Trond Myklebust
2003-06-12  0:32     ` Linus Torvalds
2003-06-12  5:22 ` Linus Torvalds
2003-06-12  6:04   ` Trond Myklebust
2003-06-12  7:30   ` Trond Myklebust
2003-06-12 16:26   ` viro
2003-06-19 23:01     ` Paul E. McKenney

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.