Skip to content

Commit 0ad30ff

Browse files
vaverinJ. Bruce Fields
authored andcommitted
nfs: fixed broken compilation in nfs_callback_up_net()
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 <lkp@intel.com> Signed-off-by: Vasily Averin <vvs@virtuozzo.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
1 parent 91bd2ff commit 0ad30ff

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎fs/nfs/callback.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ static int nfs_callback_up_net(int minorversion, struct svc_serv *serv,
210210
if (!IS_ENABLED(CONFIG_NFS_V4_1) || minorversion == 0)
211211
ret = nfs4_callback_up_net(serv, net);
212212
else if (xprt->ops->bc_setup)
213-
serv->sv_bc_enabled = true;
213+
set_bc_enabled(serv);
214214
else
215215
ret = -EPROTONOSUPPORT;
216216

‎include/linux/sunrpc/bc_xprt.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ static inline bool svc_is_backchannel(const struct svc_rqst *rqstp)
5151
{
5252
return rqstp->rq_server->sv_bc_enabled;
5353
}
54+
55+
static inline void set_bc_enabled(struct svc_serv *serv)
56+
{
57+
serv->sv_bc_enabled = true;
58+
}
5459
#else /* CONFIG_SUNRPC_BACKCHANNEL */
5560
static inline int xprt_setup_backchannel(struct rpc_xprt *xprt,
5661
unsigned int min_reqs)
@@ -63,6 +68,10 @@ static inline bool svc_is_backchannel(const struct svc_rqst *rqstp)
6368
return false;
6469
}
6570

71+
static inline void set_bc_enabled(struct svc_serv *serv)
72+
{
73+
}
74+
6675
static inline void xprt_free_bc_request(struct rpc_rqst *req)
6776
{
6877
}

0 commit comments

Comments
 (0)