Skip to content

Commit 52442f9

Browse files
bcodding-rhtrondmypd
authored andcommitted
NFS4: Avoid migration loops
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]>
1 parent 3dc1473 commit 52442f9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fs/nfs/nfs4client.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,11 @@ static int nfs4_set_client(struct nfs_server *server,
817817
goto error;
818818
}
819819

820+
if (server->nfs_client == clp) {
821+
error = -ELOOP;
822+
goto error;
823+
}
824+
820825
/*
821826
* Query for the lease time on clientid setup or renewal
822827
*

0 commit comments

Comments
 (0)