From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752034Ab1HHISi (ORCPT ); Mon, 8 Aug 2011 04:18:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64139 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751274Ab1HHISh (ORCPT ); Mon, 8 Aug 2011 04:18:37 -0400 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20110807175511.GZ2203@ZenIV.linux.org.uk> References: <20110807175511.GZ2203@ZenIV.linux.org.uk> To: Al Viro , Linus Torvalds , "Paul E. McKenney" Cc: dhowells@redhat.com, linux-kernel@vger.kernel.org Subject: Re: fix rcu annotations noise in cred.h Date: Mon, 08 Aug 2011 09:18:29 +0100 Message-ID: <13248.1312791509@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Al Viro 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? David