* [PATCH net-next] ipvs: avoid kfree_rcu without 2nd arg
@ 2023-02-01 17:56 Julian Anastasov
2023-02-02 13:02 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Julian Anastasov @ 2023-02-01 17:56 UTC (permalink / raw)
To: Pablo Neira Ayuso
Cc: Simon Horman, lvs-devel, netfilter-devel, Uladzislau Rezki
Avoid possible synchronize_rcu() as part from the
kfree_rcu() call when 2nd arg is not provided.
Signed-off-by: Julian Anastasov <ja@ssi.bg>
---
include/net/ip_vs.h | 1 +
net/netfilter/ipvs/ip_vs_est.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index c6c61100d244..6d71a5ff52df 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -461,6 +461,7 @@ void ip_vs_stats_free(struct ip_vs_stats *stats);
/* Multiple chains processed in same tick */
struct ip_vs_est_tick_data {
+ struct rcu_head rcu_head;
struct hlist_head chains[IPVS_EST_TICK_CHAINS];
DECLARE_BITMAP(present, IPVS_EST_TICK_CHAINS);
DECLARE_BITMAP(full, IPVS_EST_TICK_CHAINS);
diff --git a/net/netfilter/ipvs/ip_vs_est.c b/net/netfilter/ipvs/ip_vs_est.c
index df56073bb282..25c7118d9348 100644
--- a/net/netfilter/ipvs/ip_vs_est.c
+++ b/net/netfilter/ipvs/ip_vs_est.c
@@ -549,7 +549,7 @@ void ip_vs_stop_estimator(struct netns_ipvs *ipvs, struct ip_vs_stats *stats)
__set_bit(row, kd->avail);
if (!kd->tick_len[row]) {
RCU_INIT_POINTER(kd->ticks[row], NULL);
- kfree_rcu(td);
+ kfree_rcu(td, rcu_head);
}
kd->est_count--;
if (kd->est_count) {
--
2.39.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] ipvs: avoid kfree_rcu without 2nd arg
2023-02-01 17:56 [PATCH net-next] ipvs: avoid kfree_rcu without 2nd arg Julian Anastasov
@ 2023-02-02 13:02 ` Pablo Neira Ayuso
0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2023-02-02 13:02 UTC (permalink / raw)
To: Julian Anastasov
Cc: Simon Horman, lvs-devel, netfilter-devel, Uladzislau Rezki
On Wed, Feb 01, 2023 at 07:56:53PM +0200, Julian Anastasov wrote:
> Avoid possible synchronize_rcu() as part from the
> kfree_rcu() call when 2nd arg is not provided.
Applied to nf-next, thanks
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-02 13:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-01 17:56 [PATCH net-next] ipvs: avoid kfree_rcu without 2nd arg Julian Anastasov
2023-02-02 13:02 ` Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox