From: Anna Schumaker <anna.schumaker@oracle.com>
To: Olga Kornievskaia <okorniev@redhat.com>,
trondmy@kernel.org, anna@kernel.org
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH v3 3/4] SUNRPC: new helper function for stopping backchannel server
Date: Tue, 4 Nov 2025 15:17:12 -0500 [thread overview]
Message-ID: <83cac4e8-9130-4ae4-9c6f-857a9fa62612@oracle.com> (raw)
In-Reply-To: <20251103221339.45145-4-okorniev@redhat.com>
Hi Olga,
On 11/3/25 5:13 PM, Olga Kornievskaia wrote:
> Create a new backchannel function to stop the backchannel server
> and clear the bc_serv in transport protected under the bc_pa_lock.
>
> Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
> ---
> include/linux/sunrpc/bc_xprt.h | 5 +++++
> net/sunrpc/backchannel_rqst.c | 16 ++++++++++++++++
> 2 files changed, 21 insertions(+)
>
> diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h
> index 178f34ad8db6..9cac8f442fd4 100644
> --- a/include/linux/sunrpc/bc_xprt.h
> +++ b/include/linux/sunrpc/bc_xprt.h
> @@ -32,6 +32,7 @@ int xprt_setup_bc(struct rpc_xprt *xprt, unsigned int min_reqs);
> void xprt_destroy_bc(struct rpc_xprt *xprt, unsigned int max_reqs);
> void xprt_free_bc_rqst(struct rpc_rqst *req);
> unsigned int xprt_bc_max_slots(struct rpc_xprt *xprt);
> +void xprt_svc_destroy_nullify_bc(struct rpc_xprt *xprt, struct svc_serv **serv);
>
> /*
> * Determine if a shared backchannel is in use
> @@ -69,5 +70,9 @@ static inline void set_bc_enabled(struct svc_serv *serv)
> static inline void xprt_free_bc_request(struct rpc_rqst *req)
> {
> }
Can you add an extra line of whitespace between xprt_free_bc_request() and
xprt_svc_destroy_nullify_bc()?
> +static void xprt_svc_destroy_nullify_bc(struct rpc_xprt *xprt, struct svc_serv **serv)
I think the build warning is being triggered because this function isn't being
marked as "inline". If you fix that up, it should go away.
Thanks,
Anna
> +{
> + svc_destroy(serv);
> +}
> #endif /* CONFIG_SUNRPC_BACKCHANNEL */
> #endif /* _LINUX_SUNRPC_BC_XPRT_H */
> diff --git a/net/sunrpc/backchannel_rqst.c b/net/sunrpc/backchannel_rqst.c
> index efddea0f4b8b..68b1fcdea8f0 100644
> --- a/net/sunrpc/backchannel_rqst.c
> +++ b/net/sunrpc/backchannel_rqst.c
> @@ -24,6 +24,22 @@ unsigned int xprt_bc_max_slots(struct rpc_xprt *xprt)
> return BC_MAX_SLOTS;
> }
>
> +/*
> + * Helper function to nullify backchannel server pointer in transport.
> + * We need to synchronize setting the pointer to NULL (done so after
> + * the backchannel server is shutdown) with the usage of that pointer
> + * by the backchannel request processing routines
> + * xprt_complete_bc_request() and rpcrdma_bc_receive_call().
> + */
> +void xprt_svc_destroy_nullify_bc(struct rpc_xprt *xprt, struct svc_serv **serv)
> +{
> + spin_lock(&xprt->bc_pa_lock);
> + svc_destroy(serv);
> + xprt->bc_serv = NULL;
> + spin_unlock(&xprt->bc_pa_lock);
> +}
> +EXPORT_SYMBOL_GPL(xprt_svc_destroy_nullify_bc);
> +
> /*
> * Helper routines that track the number of preallocation elements
> * on the transport.
next prev parent reply other threads:[~2025-11-04 20:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-03 22:13 [PATCH v3 0/4] protect access to bc_serv Olga Kornievskaia
2025-11-03 22:13 ` [PATCH v3 1/4] NFSv4.1: pass transport for callback shutdown Olga Kornievskaia
2025-11-03 22:13 ` [PATCH v3 2/4] SUNRPC: cleanup common code in backchannel request Olga Kornievskaia
2025-11-03 22:13 ` [PATCH v3 3/4] SUNRPC: new helper function for stopping backchannel server Olga Kornievskaia
2025-11-04 16:52 ` kernel test robot
2025-11-04 20:17 ` Anna Schumaker [this message]
2025-11-03 22:13 ` [PATCH v3 4/4] NFSv4.1: protect destroying and nullifying bc_serv structure Olga Kornievskaia
2025-11-04 20:45 ` Anna Schumaker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83cac4e8-9130-4ae4-9c6f-857a9fa62612@oracle.com \
--to=anna.schumaker@oracle.com \
--cc=anna@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=okorniev@redhat.com \
--cc=trondmy@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).