Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fda1bfef authored by Trond Myklebust's avatar Trond Myklebust
Browse files

SUNRPC: Make freeing of struct xprt rcu-safe



Have it call kfree_rcu() to ensure that we can use it on rcu-protected
lists.

Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 30c5116b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -257,6 +257,7 @@ struct rpc_xprt {
	struct dentry		*debugfs;		/* debugfs directory */
	atomic_t		inject_disconnect;
#endif
	struct rcu_head		rcu;
};

#if defined(CONFIG_SUNRPC_BACKCHANNEL)
+2 −1
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/metrics.h>
#include <linux/sunrpc/bc_xprt.h>
#include <linux/rcupdate.h>

#include <trace/events/sunrpc.h>

@@ -1166,7 +1167,7 @@ void xprt_free(struct rpc_xprt *xprt)
{
	put_net(xprt->xprt_net);
	xprt_free_all_slots(xprt);
	kfree(xprt);
	kfree_rcu(xprt, rcu);
}
EXPORT_SYMBOL_GPL(xprt_free);