From 1588def91d58bf70afe1acf9fc0331fa26e974f4 Mon Sep 17 00:00:00 2001 From: David Howells Date: Wed, 23 May 2018 11:51:29 +0100 Subject: 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: f044c8847bb6 ("afs: Lay the groundwork for supporting network namespaces") Reported-by: kbuild test robot Signed-off-by: David Howells --- fs/afs/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/afs/proc.c') diff --git a/fs/afs/proc.c b/fs/afs/proc.c index b45ee7576aa8..362f281b1b16 100644 --- a/fs/afs/proc.c +++ b/fs/afs/proc.c @@ -173,7 +173,7 @@ static ssize_t afs_proc_rootcell_read(struct file *file, char __user *buf, if (*_pos > 0) return 0; - if (!net->ws_cell) + if (!rcu_access_pointer(net->ws_cell)) return 0; rcu_read_lock(); -- cgit v1.2.3