Skip to content

Commit e6bace7

Browse files
committed
afs: Fix afs_server_list to be cleaned up with RCU
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: 8a070a9 ("afs: Detect cell aliases 1 - Cells with root volumes") Signed-off-by: David Howells <[email protected]> cc: Marc Dionne <[email protected]> cc: [email protected]
1 parent 76df934 commit e6bace7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

fs/afs/internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,7 @@ struct afs_server_entry {
553553
};
554554

555555
struct afs_server_list {
556+
struct rcu_head rcu;
556557
afs_volid_t vids[AFS_MAXTYPES]; /* Volume IDs */
557558
refcount_t usage;
558559
unsigned char nr_servers;

fs/afs/server_list.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void afs_put_serverlist(struct afs_net *net, struct afs_server_list *slist)
1717
for (i = 0; i < slist->nr_servers; i++)
1818
afs_unuse_server(net, slist->servers[i].server,
1919
afs_server_trace_put_slist);
20-
kfree(slist);
20+
kfree_rcu(slist, rcu);
2121
}
2222
}
2323

0 commit comments

Comments
 (0)