]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
NFS4: Avoid migration loops
authorBenjamin Coddington <bcodding@redhat.com>
Tue, 30 Aug 2016 13:20:32 +0000 (09:20 -0400)
committerJack Vogel <jack.vogel@oracle.com>
Thu, 22 Mar 2018 23:33:20 +0000 (16:33 -0700)
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>
Orabug: 27679350
(cherry picked from commit 52442f9b11b7e5d4a38d99143011831fd171f8d9)
Signed-off-by: Calum Mackay <calum.mackay@oracle.com>
Reviewed-by: Manjunath Patil <manjunath.b.patil@oracle.com>
fs/nfs/nfs4client.c

index 3100f3b1a9f502f7d15d6c888d38c12cb9f208d3..e582db4bd5617c52a44152dbd16adcf41b11260d 100644 (file)
@@ -822,6 +822,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
         *