Skip to content

Commit

Permalink
NFS4: Avoid migration loops
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Benjamin Coddington authored and trondmypd committed Aug 30, 2016
1 parent 3dc1473 commit 52442f9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fs/nfs/nfs4client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down

0 comments on commit 52442f9

Please sign in to comment.