Commit 940aab49 authored by Malahal Naineni's avatar Malahal Naineni Committed by Trond Myklebust

Check validity of cl_rpcclient in nfs_server_list_show

As soon as the nfs_client gets created, its cl_rpcclient is set to
ERR_PTR(-EINVAL). The rpc client structure is allocated later. Check
if the client is ready before using the cl_rpcclient pointer.
Signed-off-by: default avatarMalahal Naineni <malahal@us.ibm.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent b6ee8cd2
...@@ -1868,6 +1868,10 @@ static int nfs_server_list_show(struct seq_file *m, void *v) ...@@ -1868,6 +1868,10 @@ static int nfs_server_list_show(struct seq_file *m, void *v)
/* display one transport per line on subsequent lines */ /* display one transport per line on subsequent lines */
clp = list_entry(v, struct nfs_client, cl_share_link); clp = list_entry(v, struct nfs_client, cl_share_link);
/* Check if the client is initialized */
if (clp->cl_cons_state != NFS_CS_READY)
return 0;
seq_printf(m, "v%u %s %s %3d %s\n", seq_printf(m, "v%u %s %s %3d %s\n",
clp->rpc_ops->version, clp->rpc_ops->version,
rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_HEX_ADDR), rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_HEX_ADDR),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment