mirror of
https://github.com/torvalds/linux.git
synced 2026-06-05 13:06:59 +02:00
afs: Fix afs_server_list to be cleaned up with RCU
[ Upstream commite6bace7313] afs_server_list is accessed with the rcu_read_lock() held from volume->servers, so it needs to be cleaned up correctly. Fix this by using kfree_rcu() instead of kfree(). Fixes:8a070a9648("afs: Detect cell aliases 1 - Cells with root volumes") Signed-off-by: David Howells <dhowells@redhat.com> cc: Marc Dionne <marc.dionne@auristor.com> cc: linux-afs@lists.infradead.org Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
2861237139
commit
3a4ef51589
|
|
@ -553,6 +553,7 @@ struct afs_server_entry {
|
|||
};
|
||||
|
||||
struct afs_server_list {
|
||||
struct rcu_head rcu;
|
||||
afs_volid_t vids[AFS_MAXTYPES]; /* Volume IDs */
|
||||
refcount_t usage;
|
||||
unsigned char nr_servers;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ void afs_put_serverlist(struct afs_net *net, struct afs_server_list *slist)
|
|||
for (i = 0; i < slist->nr_servers; i++)
|
||||
afs_unuse_server(net, slist->servers[i].server,
|
||||
afs_server_trace_put_slist);
|
||||
kfree(slist);
|
||||
kfree_rcu(slist, rcu);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user