Re: What does this sparse warning mean in posix_acl.h?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Aug 17, 2013 at 2:23 PM, Theodore Ts'o <tytso@xxxxxxx> wrote:
>
> Ah, I see.  But as we start adding the RCU annotations and the calls
> to rcu_derference(), then I imagine we'll start triggering warnings
> from various other static analysis tools, even if it makes sparse happy.

Yes. I suspect the patch I sent out might need some tweaking to make
the dynamic RCU accessor checkers happy.

That said, it's probably fairly simple. I think my patch was *almost*
correct, and the only required change would be to change the two
occurrences of

    rcu_dereference(*p);

in "get_cached_acl()" into a "rcu_dereference_protected(*p, true)" in
order to avoid the RCU read-lock sanity checking.

The second access is actually under the i_lock (so the "protected"
part is clearly correct), and as mentioned, the first one is special
and we only use the value if it is NULL, so the "protected" is not
technically true, but it's a special case, and together with a comment
about why NULL is fine and doesn't need rcu locking it should all be
good.

The alternative is to basically say that the ACL pointers aren't
really RCU at all, and just use ACCESS_ONCE() like we do. And then
just cast things in get_cached_acl_rcu() to shut things up.

                  Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux