]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
afs: Fix server rotation's handling of fileserver probe failure
authorDavid Howells <dhowells@redhat.com>
Thu, 10 May 2018 13:22:38 +0000 (14:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Jun 2018 19:01:44 +0000 (04:01 +0900)
[ Upstream commit ec5a3b4b507efca903d848518dcf2ebf7b04b466 ]

The server rotation algorithm just gives up if it fails to probe a
fileserver.  Fix this by rotating to the next fileserver instead.

Fixes: d2ddc776a458 ("afs: Overhaul volume and server record caching and fileserver rotation")
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/rotate.c

index 574d96099bcf5ae0004872b56c601903983f81a7..8a444bf7e167142b0969d0964910d1abf204e3e4 100644 (file)
@@ -369,8 +369,16 @@ use_server:
        if (!test_bit(AFS_SERVER_FL_PROBED, &server->flags)) {
                fc->ac.alist = afs_get_addrlist(alist);
 
-               if (!afs_probe_fileserver(fc))
-                       goto failed;
+               if (!afs_probe_fileserver(fc)) {
+                       switch (fc->ac.error) {
+                       case -ENOMEM:
+                       case -ERESTARTSYS:
+                       case -EINTR:
+                               goto failed;
+                       default:
+                               goto next_server;
+                       }
+               }
        }
 
        if (!fc->ac.alist)