]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Check validity of cl_rpcclient in nfs_server_list_show
authorMalahal Naineni <malahal@us.ibm.com>
Wed, 21 Sep 2011 00:27:14 +0000 (17:27 -0700)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Thu, 20 Oct 2011 23:44:04 +0000 (18:44 -0500)
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: Malahal Naineni <malahal@us.ibm.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/client.c

index b4e41dd4d0f6936b6c566ce68b2721b72702dd38..873bf00d51a2b8d000ef9d45bdb9f139186ec6e5 100644 (file)
@@ -1868,6 +1868,10 @@ static int nfs_server_list_show(struct seq_file *m, void *v)
        /* display one transport per line on subsequent lines */
        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",
                   clp->rpc_ops->version,
                   rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_HEX_ADDR),