Skip to content

Commit

Permalink
nfs: fixed broken compilation in nfs_callback_up_net()
Browse files Browse the repository at this point in the history
Patch fixes compilation error in nfs_callback_up_net()
serv->sv_bc_enabled is defined under enabled CONFIG_SUNRPC_BACKCHANNEL,
however nfs_callback_up_net() can access it even if this config option
was not set.

Fixes: a289ce5 (sunrpc: replace svc_serv->sv_bc_xprt by boolean flag)
Reported-by: kbuild test robot <[email protected]>
Signed-off-by: Vasily Averin <[email protected]>
Signed-off-by: J. Bruce Fields <[email protected]>
  • Loading branch information
vaverin authored and J. Bruce Fields committed Dec 31, 2018
1 parent 91bd2ff commit 0ad30ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfs/callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ static int nfs_callback_up_net(int minorversion, struct svc_serv *serv,
if (!IS_ENABLED(CONFIG_NFS_V4_1) || minorversion == 0)
ret = nfs4_callback_up_net(serv, net);
else if (xprt->ops->bc_setup)
serv->sv_bc_enabled = true;
set_bc_enabled(serv);
else
ret = -EPROTONOSUPPORT;

Expand Down
9 changes: 9 additions & 0 deletions include/linux/sunrpc/bc_xprt.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ static inline bool svc_is_backchannel(const struct svc_rqst *rqstp)
{
return rqstp->rq_server->sv_bc_enabled;
}

static inline void set_bc_enabled(struct svc_serv *serv)
{
serv->sv_bc_enabled = true;
}
#else /* CONFIG_SUNRPC_BACKCHANNEL */
static inline int xprt_setup_backchannel(struct rpc_xprt *xprt,
unsigned int min_reqs)
Expand All @@ -63,6 +68,10 @@ static inline bool svc_is_backchannel(const struct svc_rqst *rqstp)
return false;
}

static inline void set_bc_enabled(struct svc_serv *serv)
{
}

static inline void xprt_free_bc_request(struct rpc_rqst *req)
{
}
Expand Down

0 comments on commit 0ad30ff

Please sign in to comment.