summaryrefslogtreecommitdiff
path: root/net/sunrpc/xprtmultipath.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2019-07-18 01:10:51 -0400
committerTrond Myklebust <trond.myklebust@hammerspace.com>2019-07-18 01:12:59 -0400
commit9f98effc19bd490a375c4e764a56a2c015d27c3c (patch)
tree2e3e9af579aa10667f75e8bea2fe31747824464f /net/sunrpc/xprtmultipath.c
parent163f88211c147d96b46e376337190a02203ace02 (diff)
SUNRPC: Fix initialisation of struct rpc_xprt_switch
Ensure that we do initialise the fields xps_nactive, xps_queuelen and xps_net. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'net/sunrpc/xprtmultipath.c')
-rw-r--r--net/sunrpc/xprtmultipath.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sunrpc/xprtmultipath.c b/net/sunrpc/xprtmultipath.c
index c12778e1235e..f3ecd0bee484 100644
--- a/net/sunrpc/xprtmultipath.c
+++ b/net/sunrpc/xprtmultipath.c
@@ -103,7 +103,9 @@ struct rpc_xprt_switch *xprt_switch_alloc(struct rpc_xprt *xprt,
if (xps != NULL) {
spin_lock_init(&xps->xps_lock);
kref_init(&xps->xps_kref);
- xps->xps_nxprts = 0;
+ xps->xps_nxprts = xps->xps_nactive = 0;
+ atomic_long_set(&xps->xps_queuelen, 0);
+ xps->xps_net = NULL;
INIT_LIST_HEAD(&xps->xps_xprt_list);
xps->xps_iter_ops = &rpc_xprt_iter_singular;
xprt_switch_add_xprt_locked(xps, xprt);