aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fs/afs/dynroot.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2018-10-11 22:45:49 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-12 13:18:57 +0200
commit6b3944e42e2e554aa5a4be681ecd70dccd459114 (patch)
tree811bc9bccb4da48aed07bd73891b65181b6e5873 /fs/afs/dynroot.c
parentMerge tag 'mmc-v4.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc (diff)
downloadwireguard-linux-6b3944e42e2e554aa5a4be681ecd70dccd459114.tar.xz
wireguard-linux-6b3944e42e2e554aa5a4be681ecd70dccd459114.zip
afs: Fix cell proc list
Access to the list of cells by /proc/net/afs/cells has a couple of problems: (1) It should be checking against SEQ_START_TOKEN for the keying the header line. (2) It's only holding the RCU read lock, so it can't just walk over the list without following the proper RCU methods. Fix these by using an hlist instead of an ordinary list and using the appropriate accessor functions to follow it with RCU. Since the code that adds a cell to the list must also necessarily change, sort the list on insertion whilst we're at it. Fixes: 989782dcdc91 ("afs: Overhaul cell database management") Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/afs/dynroot.c')
-rw-r--r--fs/afs/dynroot.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/afs/dynroot.c b/fs/afs/dynroot.c
index 1cde710a8013..f29c6dade7f6 100644
--- a/fs/afs/dynroot.c
+++ b/fs/afs/dynroot.c
@@ -265,7 +265,7 @@ int afs_dynroot_populate(struct super_block *sb)
return -ERESTARTSYS;
net->dynroot_sb = sb;
- list_for_each_entry(cell, &net->proc_cells, proc_link) {
+ hlist_for_each_entry(cell, &net->proc_cells, proc_link) {
ret = afs_dynroot_mkdir(net, cell);
if (ret < 0)
goto error;