aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4client.c
diff options
context:
space:
mode:
authorBenjamin Coddington <bcodding@redhat.com>2016-08-30 09:20:32 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2016-08-30 09:26:32 -0400
commit52442f9b11b7e5d4a38d99143011831fd171f8d9 (patch)
treee176efeec7f9baa9e9d30429cab9f85ae838f7a1 /fs/nfs/nfs4client.c
parentpNFS/flexfiles: Fix an Oopsable condition when connection to the DS fails (diff)
downloadlinux-dev-52442f9b11b7e5d4a38d99143011831fd171f8d9.tar.xz
linux-dev-52442f9b11b7e5d4a38d99143011831fd171f8d9.zip
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 <bcodding@redhat.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/nfs4client.c')
-rw-r--r--fs/nfs/nfs4client.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index 8d7d08d4f95f..cd3b7cfdde16 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -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
*