Re: [PATCH] 2.5.39-mm1 fixes 3/3

Dipankar Sarma (dipankar@in.ibm.com)
Mon, 30 Sep 2002 16:47:38 +0530


The dcache_rcu patch should use the RCU list macros which make sure
of the barrier requirements. Fix against 2.5.39-mm1.

Thanks

-- 
Dipankar Sarma  <dipankar@in.ibm.com> http://lse.sourceforge.net
Linux Technology Center, IBM Software Lab, Bangalore, India.

--- fs/dcache.c.orig Mon Sep 30 14:00:40 2002 +++ fs/dcache.c Mon Sep 30 14:05:33 2002 @@ -869,14 +869,8 @@ struct dentry *found = NULL; rcu_read_lock(); - tmp = head->next; - for (;;) { - struct dentry * dentry; - read_barrier_depends(); - dentry = list_entry(tmp, struct dentry, d_hash); - if (tmp == head) - break; - tmp = tmp->next; + list_for_each_rcu(tmp, head) { + struct dentry * dentry = list_entry(tmp, struct dentry, d_hash); if (dentry->d_name.hash != hash) continue; if (dentry->d_parent != parent) @@ -999,7 +993,7 @@ struct list_head *list = d_hash(entry->d_parent, entry->d_name.hash); spin_lock(&dcache_lock); if (!list_empty(&entry->d_hash) && !d_unhashed(entry)) BUG(); - list_add(&entry->d_hash, list); + list_add_rcu(&entry->d_hash, list); entry->d_vfs_flags &= ~DCACHE_UNHASHED; spin_unlock(&dcache_lock); } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/