Message ID | 20240207222902.1469398-1-victor@mojatatu.com (mailing list archive) |
---|---|
State | Accepted |
Commit | aae09a6c7783e28d1bcafee85e172fe411923b22 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net,v2] net/sched: act_mirred: Don't zero blockid when net device is being deleted | expand |
On Wed, Feb 07, 2024 at 07:29:02PM -0300, Victor Nogueira wrote: > While testing tdc with parallel tests for mirred to block we caught an > intermittent bug. The blockid was being zeroed out when a net device > was deleted and, thus, giving us an incorrect blockid value whenever > we tried to dump the mirred action. Since we don't increment the block > refcount in the control path (and only use the ID), we don't need to > zero the blockid field whenever a net device is going down. > > Fixes: 42f39036cda8 ("net/sched: act_mirred: Allow mirred to block") > Signed-off-by: Victor Nogueira <victor@mojatatu.com> > --- > v1 -> v2: > - Reword commit message to emphasise the bug is caused when a net > device is being deleted > - Reword subject to emphasise the bug is caused when a net device is > being deleted. Original patch subject was: > "net/sched: act_mirred: Don't zero blockid when netns is going down" Thanks for the update. Reviewed-by: Simon Horman <horms@kernel.org>
On Wed, Feb 7, 2024 at 11:29 PM Victor Nogueira <victor@mojatatu.com> wrote: > > While testing tdc with parallel tests for mirred to block we caught an > intermittent bug. The blockid was being zeroed out when a net device > was deleted and, thus, giving us an incorrect blockid value whenever > we tried to dump the mirred action. Since we don't increment the block > refcount in the control path (and only use the ID), we don't need to > zero the blockid field whenever a net device is going down. > > Fixes: 42f39036cda8 ("net/sched: act_mirred: Allow mirred to block") > Signed-off-by: Victor Nogueira <victor@mojatatu.com> Reviewed-by: Eric Dumazet <edumazet@google.com>
On Wed, Feb 7, 2024 at 5:29 PM Victor Nogueira <victor@mojatatu.com> wrote: > > While testing tdc with parallel tests for mirred to block we caught an > intermittent bug. The blockid was being zeroed out when a net device > was deleted and, thus, giving us an incorrect blockid value whenever > we tried to dump the mirred action. Since we don't increment the block > refcount in the control path (and only use the ID), we don't need to > zero the blockid field whenever a net device is going down. > > Fixes: 42f39036cda8 ("net/sched: act_mirred: Allow mirred to block") > Signed-off-by: Victor Nogueira <victor@mojatatu.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> cheers, jamal > --- > v1 -> v2: > - Reword commit message to emphasise the bug is caused when a net > device is being deleted > - Reword subject to emphasise the bug is caused when a net device is > being deleted. Original patch subject was: > "net/sched: act_mirred: Don't zero blockid when netns is going down" > > net/sched/act_mirred.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c > index 93a96e9d8d90..6f4bb1c8ce7b 100644 > --- a/net/sched/act_mirred.c > +++ b/net/sched/act_mirred.c > @@ -533,8 +533,6 @@ static int mirred_device_event(struct notifier_block *unused, > * net_device are already rcu protected. > */ > RCU_INIT_POINTER(m->tcfm_dev, NULL); > - } else if (m->tcfm_blockid) { > - m->tcfm_blockid = 0; > } > spin_unlock_bh(&m->tcf_lock); > } > -- > 2.34.1 >
Hello: This patch was applied to netdev/net.git (main) by Jakub Kicinski <kuba@kernel.org>: On Wed, 7 Feb 2024 19:29:02 -0300 you wrote: > While testing tdc with parallel tests for mirred to block we caught an > intermittent bug. The blockid was being zeroed out when a net device > was deleted and, thus, giving us an incorrect blockid value whenever > we tried to dump the mirred action. Since we don't increment the block > refcount in the control path (and only use the ID), we don't need to > zero the blockid field whenever a net device is going down. > > [...] Here is the summary with links: - [net,v2] net/sched: act_mirred: Don't zero blockid when net device is being deleted https://git.kernel.org/netdev/net/c/aae09a6c7783 You are awesome, thank you!
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index 93a96e9d8d90..6f4bb1c8ce7b 100644 --- a/net/sched/act_mirred.c +++ b/net/sched/act_mirred.c @@ -533,8 +533,6 @@ static int mirred_device_event(struct notifier_block *unused, * net_device are already rcu protected. */ RCU_INIT_POINTER(m->tcfm_dev, NULL); - } else if (m->tcfm_blockid) { - m->tcfm_blockid = 0; } spin_unlock_bh(&m->tcf_lock); }
While testing tdc with parallel tests for mirred to block we caught an intermittent bug. The blockid was being zeroed out when a net device was deleted and, thus, giving us an incorrect blockid value whenever we tried to dump the mirred action. Since we don't increment the block refcount in the control path (and only use the ID), we don't need to zero the blockid field whenever a net device is going down. Fixes: 42f39036cda8 ("net/sched: act_mirred: Allow mirred to block") Signed-off-by: Victor Nogueira <victor@mojatatu.com> --- v1 -> v2: - Reword commit message to emphasise the bug is caused when a net device is being deleted - Reword subject to emphasise the bug is caused when a net device is being deleted. Original patch subject was: "net/sched: act_mirred: Don't zero blockid when netns is going down" net/sched/act_mirred.c | 2 -- 1 file changed, 2 deletions(-)