public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dipankar Sarma <dipankar@in.ibm.com>
To: Andrew Morton <akpm@zip.com.au>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 2.5.39-mm1 fixes 3/3
Date: Mon, 30 Sep 2002 16:47:38 +0530	[thread overview]
Message-ID: <20020930164738.C27121@in.ibm.com> (raw)
In-Reply-To: <20020930164547.B27121@in.ibm.com>; from dipankar@in.ibm.com on Mon, Sep 30, 2002 at 04:45:47PM +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);
 }

      reply	other threads:[~2002-09-30 11:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-30 11:13 [PATCH] 2.5.39-mm1 fixes 1/3 Dipankar Sarma
2002-09-30 11:15 ` [PATCH] 2.5.39-mm1 fixes 2/3 Dipankar Sarma
2002-09-30 11:17   ` Dipankar Sarma [this message]

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=20020930164738.C27121@in.ibm.com \
    --to=dipankar@in.ibm.com \
    --cc=akpm@zip.com.au \
    --cc=linux-kernel@vger.kernel.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