From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: David Howells <dhowells@redhat.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: fix rcu annotations noise in cred.h
Date: Mon, 8 Aug 2011 05:34:42 -0700 [thread overview]
Message-ID: <20110808123442.GF2385@linux.vnet.ibm.com> (raw)
In-Reply-To: <13248.1312791509@redhat.com>
On Mon, Aug 08, 2011 at 09:18:29AM +0100, David Howells wrote:
>
> Al Viro <viro@ZenIV.linux.org.uk> wrote:
>
> > #define current_cred() \
> > - (current->cred)
> > + (*(__force struct cred **)¤t->cred)
>
> No. You've cast away the const. Please don't do that.
>
> Paul: isn't there some better way of doing this using an RCU wrapper macro?
>
> #define current_cred() \
> rcu_dereference_protected(current->cred, 1)
>
> Perhaps?
This is indeed what rcu_dereference_protected() is intended for.
Thanx, Paul
next prev parent reply other threads:[~2011-08-08 12:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-07 17:55 fix rcu annotations noise in cred.h Al Viro
2011-08-08 8:18 ` David Howells
2011-08-08 8:28 ` Al Viro
2011-08-08 12:34 ` Paul E. McKenney [this message]
2011-08-08 12:54 ` David Howells
2011-08-08 14:35 ` Paul E. McKenney
2011-08-08 12:28 ` David Howells
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=20110808123442.GF2385@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=dhowells@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@ZenIV.linux.org.uk \
/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