From: Andy Adamson <andros@xxxxxxxxxx> Used by /proc/fs/nfsfs files. Signed-off-by: Andy Adamson <andros@xxxxxxxxxx> --- fs/nfs/client.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/fs/nfs/client.c b/fs/nfs/client.c index d0f850f..9e9cb50 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -1468,7 +1468,21 @@ struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp, */ clp = nfs_get_client(&cl_init, &ds_timeout, mds_clp->cl_ipaddr, mds_clp->cl_rpcclient->cl_auth->au_flavor, 0); + if (IS_ERR(clp)) + return clp; + /* + * cl_init.servername is NULL so the cl_hostname is not set for new + * ds nfs_clients + */ + if (clp->cl_hostname == NULL) { + clp->cl_hostname = kstrdup(clp->cl_rpcclient->cl_server, + GFP_KERNEL); + if (clp->cl_hostname == NULL) { + nfs_put_client(clp); + return ERR_PTR(-ENOMEM); + } + } dprintk("<-- %s %p\n", __func__, clp); return clp; } -- 1.7.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html