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: 989782dcdc
("afs: Overhaul cell database management")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
4ea07abbfb
commit
6b3944e42e
@@ -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;
|
||||
|
Reference in New Issue
Block a user