Linux-NFS Archive on lore.kernel.org
 help / Atom feed
* [PATCH] nfs: fixed broken compilation in nfs_callback_up_net()
@ 2018-12-29 13:38 Vasily Averin
  0 siblings, 0 replies; 1+ messages in thread
From: Vasily Averin @ 2018-12-29 13:38 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: linux-nfs

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 ???? ("sunrpc: replace svc_serv->sv_bc_xprt by boolean flag")

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
 fs/nfs/callback.c              | 2 +-
 include/linux/sunrpc/bc_xprt.h | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
index 82fa65da741b..0b602a39dd71 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
@@ -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;
 
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h
index 4e8c773d02be..d4229a78524a 100644
--- a/include/linux/sunrpc/bc_xprt.h
+++ b/include/linux/sunrpc/bc_xprt.h
@@ -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)
@@ -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)
 {
 }
-- 
2.17.1


^ permalink raw reply	[flat|nested] 1+ messages in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-29 13:38 [PATCH] nfs: fixed broken compilation in nfs_callback_up_net() Vasily Averin

Linux-NFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nfs/0 linux-nfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nfs linux-nfs/ https://lore.kernel.org/linux-nfs \
		linux-nfs@vger.kernel.org linux-nfs@archiver.kernel.org
	public-inbox-index linux-nfs


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-nfs


AGPL code for this site: git clone https://public-inbox.org/ public-inbox