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 <dhowells@redhat.com>
This commit is contained in:
David Howells
2017-11-02 15:27:46 +00:00
rodzic 49566f6f06
commit 9ed900b116
11 zmienionych plików z 56 dodań i 56 usunięć

Wyświetl plik

@@ -151,7 +151,7 @@ static void afs_cm_destructor(struct afs_call *call)
afs_break_callbacks(call->server, call->count, call->request);
}
afs_put_server(call->server);
afs_put_server(call->net, call->server);
call->server = NULL;
kfree(call->buffer);
call->buffer = NULL;