nfsv4: set hostname when creating nfsv4 ds connection
authorPeng Tao <tao.peng@primarydata.com>
Tue, 8 Jul 2014 03:45:47 +0000 (11:45 +0800)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 8 Jul 2014 18:30:03 +0000 (14:30 -0400)
We reference cl_hostname in many places for debugging purpose.
So make it useful by setting hostname when calling nfs_get_client.

Signed-off-by: Peng Tao <tao.peng@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/nfs4client.c

index aa9ef4876046aa17cc43c201d33ba6dbe49f1b8f..53e435a952602aa5037cc8a9605b399f646edc81 100644 (file)
@@ -855,6 +855,11 @@ struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp,
        };
        struct rpc_timeout ds_timeout;
        struct nfs_client *clp;
+       char buf[INET6_ADDRSTRLEN + 1];
+
+       if (rpc_ntop(ds_addr, buf, sizeof(buf)) <= 0)
+               return ERR_PTR(-EINVAL);
+       cl_init.hostname = buf;
 
        /*
         * Set an authflavor equual to the MDS value. Use the MDS nfs_client