From: "Ted Ts'o" <tytso@mit.edu>
To: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Steven Rostedt <rostedt@goodmis.org>, Ingo Molnar <mingo@elte.hu>,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] jbd2,rcu: correctly use RCU
Date: Sun, 10 Jul 2011 20:25:02 -0400 [thread overview]
Message-ID: <20110711002502.GC28763@thunk.org> (raw)
In-Reply-To: <ec67960d0864680d18a43ec5275baba3f6e1dd94.1308131436.git.laijs@cn.fujitsu.com>
On Thu, Jun 16, 2011 at 09:47:04AM +0800, Lai Jiangshan wrote:
> In read site, we need to use local_ptr = rcu_dereference(),
> and then use this local_ptr to read the content.
>
> In update site, we should assign/publish the new object/pointer after
> the content of the new object/pointer is fully initialized,
> and we can't not touch the object after the pointer assignment.
> rcu_assign_pointer() is need for the assignement.
>
> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Thanks, applied.
> @@ -2447,24 +2447,25 @@ const char *jbd2_dev_to_name(dev_t device)
> int i = hash_32(device, CACHE_SIZE_BITS);
> char *ret;
> struct block_device *bd;
> - static struct devname_cache *new_dev;
> + static struct devname_cache *cache;
I also removed the static modifier to the struct devname_cache
pointer. It's pointless, and in fact introduces a bug if two CPU's
try to run jbd2_dev_to_name() at the same time.
- Ted
next prev parent reply other threads:[~2011-07-11 0:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-16 1:47 [PATCH 1/3] jbd2,rcu: correctly use RCU Lai Jiangshan
2011-06-16 1:47 ` [PATCH 2/3] jbd2,tracing,rcu: jbd2_dev_to_name() is not protect by RCU Lai Jiangshan
2011-07-08 2:06 ` Steven Rostedt
2011-07-08 16:02 ` Paul E. McKenney
2011-06-16 1:47 ` [PATCH 3/3] jbd2,rcu: simpify jbd2_dev_to_name() Lai Jiangshan
2011-07-11 0:25 ` Ted Ts'o [this message]
2011-07-11 1:24 ` [PATCH 1/3] jbd2,rcu: correctly use RCU Ted Ts'o
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=20110711002502.GC28763@thunk.org \
--to=tytso@mit.edu \
--cc=laijs@cn.fujitsu.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulmck@linux.vnet.ibm.com \
--cc=rostedt@goodmis.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