Linux SPARSE checker discussions
 help / color / mirror / Atom feed
From: Josh Triplett <josh@joshtriplett.org>
To: Theodore Ts'o <tytso@thunk.org>
Cc: linux-fsdevel@vger.kernel.org, linux-sparse@vger.kernel.org
Subject: Re: What does this sparse warning mean in posix_acl.h?
Date: Sat, 17 Aug 2013 09:17:18 -0700	[thread overview]
Message-ID: <20130817161718.GA18897@leaf> (raw)
In-Reply-To: <nsxtxio1jeh.fsf@lambda.thunk.org>

On Sat, Aug 17, 2013 at 10:28:22AM -0400, Theodore Ts'o wrote:
> It apparently has something to do with rcu and "address spaces" but I'm
> not completely sure what sparse is complaining about --- and whether it
> is a false positive or a bug in the posix_acl.h.
> 
> Can someone explain what's going on, and whether it's something to be
> concerned about?
[...]
> /usr/projects/linux/ext4/include/linux/posix_acl.h:137:9: warning: incorrect type in assignment (different address spaces)
> /usr/projects/linux/ext4/include/linux/posix_acl.h:137:9:    expected struct posix_acl *<noident>
> /usr/projects/linux/ext4/include/linux/posix_acl.h:137:9:    got struct posix_acl [noderef] <asn:4>*<noident>
> /usr/projects/linux/ext4/include/linux/posix_acl.h:137:9: warning: incorrect type in assignment (different address spaces)
> /usr/projects/linux/ext4/include/linux/posix_acl.h:137:9:    expected struct posix_acl *<noident>
> /usr/projects/linux/ext4/include/linux/posix_acl.h:137:9:    got struct posix_acl [noderef] <asn:4>*<noident>

Address space 4 is __rcu.  This warning means you accessed an RCU
pointer directly, without using the appropriate RCU primitive
(rcu_assign_pointer, rcu_dereference, etc).

- Josh Triplett

  parent reply	other threads:[~2013-08-17 16:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-17 14:28 What does this sparse warning mean in posix_acl.h? Theodore Ts'o
2013-08-17 16:16 ` Linus Torvalds
2013-08-17 20:55   ` Theodore Ts'o
2013-08-17 21:14     ` Linus Torvalds
2013-08-17 21:23       ` Theodore Ts'o
2013-08-17 21:31         ` Linus Torvalds
2013-08-17 21:23       ` Linus Torvalds
2013-08-17 16:17 ` Josh Triplett [this message]
2013-08-17 16:33   ` Linus Torvalds

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=20130817161718.GA18897@leaf \
    --to=josh@joshtriplett.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=tytso@thunk.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