From 9ed900b1160ef306bc74ad0228d7ab199234c758 Mon Sep 17 00:00:00 2001 From: David Howells Date: Thu, 2 Nov 2017 15:27:46 +0000 Subject: afs: Push the net ns pointer to more places Push the network namespace pointer to more places in AFS, including the afs_server structure (which doesn't hold a ref on the netns). In particular, afs_put_cell() now takes requires a net ns parameter so that it can safely alter the netns after decrementing the cell usage count - the cell will be deallocated by a background thread after being cached for a period, which means that it's not safe to access it after reducing its usage count. 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 c93433460348..677a453b08bf 100644 --- a/fs/afs/proc.c +++ b/fs/afs/proc.c @@ -285,7 +285,7 @@ static ssize_t afs_proc_cells_write(struct file *file, const char __user *buf, goto done; } - afs_put_cell(cell); + afs_put_cell(net, cell); printk("kAFS: Added new cell '%s'\n", name); } else { goto inval; -- cgit v1.2.3-58-ga151