diff options
author | David Howells <dhowells@redhat.com> | 2018-02-06 14:12:32 +0000 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2018-02-06 14:36:54 +0000 |
commit | 45df8462730d2149834980d3db16e2d2b9daaf60 (patch) | |
tree | b884a2ea9e5c704a5ec90caf905a3a1902f7ce74 /fs/afs/server_list.c | |
parent | 8305e579c653b127b292fcdce551e930f9560260 (diff) | |
download | linux-45df8462730d2149834980d3db16e2d2b9daaf60.tar.bz2 |
afs: Fix server list handling
Fix server list handling in the following ways:
(1) In afs_alloc_volume(), remove duplicate server list build code. This
was already done by afs_alloc_server_list() which afs_alloc_volume()
previously called. This just results in twice as many VL RPCs.
(2) In afs_deliver_vl_get_entry_by_name_u(), use the number of server
records indicated by ->nServers in the UVLDB record returned by the
VL.GetEntryByNameU RPC call rather than scanning all NMAXNSERVERS
slots. Unused slots may contain garbage.
(3) In afs_alloc_server_list(), don't stop converting a UVLDB record into
a server list just because we can't look up one of the servers. Just
skip that server and go on to the next. If we can't look up any of
the servers then we'll fail at the end.
Without this patch, an attempt to view the umich.edu root cell using
something like "ls /afs/umich.edu" on a dynamic root (future patch) mount
or an autocell mount will result in ENOMEDIUM. The failure is due to kafs
not stopping after nServers'worth of records have been read, but then
trying to access a server with a garbage UUID and getting an error, which
aborts the server list build.
Fixes: d2ddc776a458 ("afs: Overhaul volume and server record caching and fileserver rotation")
Reported-by: Jonathan Billings <jsbillings@jsbillings.org>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: stable@vger.kernel.org
Diffstat (limited to 'fs/afs/server_list.c')
-rw-r--r-- | fs/afs/server_list.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/afs/server_list.c b/fs/afs/server_list.c index 0ab3f8457839..0f8dc4c8f07c 100644 --- a/fs/afs/server_list.c +++ b/fs/afs/server_list.c @@ -58,7 +58,8 @@ struct afs_server_list *afs_alloc_server_list(struct afs_cell *cell, server = afs_lookup_server(cell, key, &vldb->fs_server[i]); if (IS_ERR(server)) { ret = PTR_ERR(server); - if (ret == -ENOENT) + if (ret == -ENOENT || + ret == -ENOMEDIUM) continue; goto error_2; } |