]> Git Repo - linux.git/commitdiff
NFS4: Avoid migration loops
authorBenjamin Coddington <[email protected]>
Tue, 30 Aug 2016 13:20:32 +0000 (09:20 -0400)
committerTrond Myklebust <[email protected]>
Tue, 30 Aug 2016 13:26:32 +0000 (09:26 -0400)
If a server returns itself as a location while migrating, the client may
end up getting stuck attempting to migrate twice to the same server.  Catch
this by checking if the nfs_client found is the same as the existing
client.  For the other two callers to nfs4_set_client, the nfs_client will
always be ERR_PTR(-EINVAL).

Signed-off-by: Benjamin Coddington <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]>
fs/nfs/nfs4client.c

index 8d7d08d4f95f17e09d53bda53da364ef02ea05b8..cd3b7cfdde16ae0e16cc17fbc9389ffc60eb511a 100644 (file)
@@ -817,6 +817,11 @@ static int nfs4_set_client(struct nfs_server *server,
                goto error;
        }
 
+       if (server->nfs_client == clp) {
+               error = -ELOOP;
+               goto error;
+       }
+
        /*
         * Query for the lease time on clientid setup or renewal
         *
This page took 0.060007 seconds and 4 git commands to generate.