]> git.baikalelectronics.ru Git - kernel.git/commit
afs: Mark afs_net::ws_cell as __rcu and set using rcu functions
authorDavid Howells <dhowells@redhat.com>
Wed, 23 May 2018 10:51:29 +0000 (11:51 +0100)
committerDavid Howells <dhowells@redhat.com>
Wed, 23 May 2018 10:51:29 +0000 (11:51 +0100)
commitaeb2854f6914cc84cb05568c580c3fe8af8e0eda
treed018c9b539d1c789b4dc8bba4c59226a22433a2d
parent2905fc7122dcde34cb1ef133596f0ceb0a711bac
afs: Mark afs_net::ws_cell as __rcu and set using rcu functions

The afs_net::ws_cell member is sometimes used under RCU conditions from
within an seq-readlock.  It isn't, however, marked __rcu and it isn't set
using the proper RCU barrier-imposing functions.

Fix this by annotating it with __rcu and using appropriate barriers to
make sure accesses are correctly ordered.

Without this, the code can produce the following warning:

>> fs/afs/proc.c:151:24: sparse: incompatible types in comparison expression (different address spaces)

Fixes: 5f563575f38e ("afs: Lay the groundwork for supporting network namespaces")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: David Howells <dhowells@redhat.com>
fs/afs/cell.c
fs/afs/internal.h
fs/afs/proc.c