From e98167379b1befa1af0001ee84b5d77969c3f5ba Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 27 Jul 2005 17:20:02 +0000 Subject: [PATCH] b=5210 r=phil(actual patch) A workaround for the crash in ll_unhash_aliases on 2.6. The 2.6 lookup code is now lockless (thanks to the RCU machinations), which allows it to race with the unhashing in ll_unhash_aliases. The 2.6 __d_drop doesn't leave the list head ->pprev in a safe state, so the next pass through this loop (which tries to re-hash it after we lose the dput race), would crash. For the record, it looks like the kernel's own d_prune_aliases is broken in the very same way, except that instead of crashing immediately, it just leaves the d_hash pointers poisoned for someone else to crash on. --- lustre/llite/dcache.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lustre/llite/dcache.c b/lustre/llite/dcache.c index 7bd2cdc..0bb8b83 100644 --- a/lustre/llite/dcache.c +++ b/lustre/llite/dcache.c @@ -168,6 +168,9 @@ restart: dentry->d_inode); dget_locked(dentry); __d_drop(dentry); +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) + INIT_HLIST_NODE(&dentry->d_hash); +#endif spin_unlock(&dcache_lock); dput(dentry); goto restart; -- 1.8.3.1