afs: Fix afs_find_server search loop
authorMarc Dionne <marc.dionne@auristor.com>
Sat, 12 May 2018 00:35:06 +0000 (21:35 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Jun 2018 19:01:44 +0000 (04:01 +0900)
commitfc83d865d73cb788561b3fdc5c24649516024477
tree4fb0d6ed003deab6026614987f4b41b76852f0d7
parent97d8137763df271fb65c01b3b9e4db0202129ac7
afs: Fix afs_find_server search loop

[ Upstream commit f9c1bba3d392843f046d2ee27b4dfcec989d8a4b ]

The code that looks up servers by addresses makes the assumption
that the list of addresses for a server is sorted.  It exits the
loop if it finds that the target address is larger than the
current candidate.  As the list is not currently sorted, this
can lead to a failure to find a matching server, which can cause
callbacks from that server to be ignored.

Remove the early exit case so that the complete list is searched.

Fixes: d2ddc776a458 ("afs: Overhaul volume and server record caching and fileserver rotation")
Signed-off-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/afs/server.c