netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: devlink: Remove overzealous WARN_ON with snapshots
@ 2020-08-16 19:26 Andrew Lunn
  2020-08-16 19:39 ` Andrew Lunn
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andrew Lunn @ 2020-08-16 19:26 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Chris Healy, jiri, Andrew Lunn

It is possible to trigger this WARN_ON from user space by triggering a
devlink snapshot with an ID which already exists. We don't need both
-EEXISTS being reported and spamming the kernel log.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 net/core/devlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/devlink.c b/net/core/devlink.c
index e674f0f46dc2..e5feb87beca7 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -4063,7 +4063,7 @@ static int __devlink_snapshot_id_insert(struct devlink *devlink, u32 id)
 {
 	lockdep_assert_held(&devlink->lock);
 
-	if (WARN_ON(xa_load(&devlink->snapshot_ids, id)))
+	if (xa_load(&devlink->snapshot_ids, id))
 		return -EEXIST;
 
 	return xa_err(xa_store(&devlink->snapshot_ids, id, xa_mk_value(0),
-- 
2.28.0


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

* Re: [PATCH] net: devlink: Remove overzealous WARN_ON with snapshots
  2020-08-16 19:26 [PATCH] net: devlink: Remove overzealous WARN_ON with snapshots Andrew Lunn
@ 2020-08-16 19:39 ` Andrew Lunn
  2020-08-16 21:21 ` Chris Healy
  2020-08-17  4:07 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2020-08-16 19:39 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Chris Healy, jiri

On Sun, Aug 16, 2020 at 09:26:38PM +0200, Andrew Lunn wrote:
> It is possible to trigger this WARN_ON from user space by triggering a
> devlink snapshot with an ID which already exists. We don't need both
> -EEXISTS being reported and spamming the kernel log.

Upps. Forgot the net-next in the subject line.

Jiri, should we backport this? I can rebase onto net?

      Andrew

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

* Re: [PATCH] net: devlink: Remove overzealous WARN_ON with snapshots
  2020-08-16 19:26 [PATCH] net: devlink: Remove overzealous WARN_ON with snapshots Andrew Lunn
  2020-08-16 19:39 ` Andrew Lunn
@ 2020-08-16 21:21 ` Chris Healy
  2020-08-17  4:07 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Chris Healy @ 2020-08-16 21:21 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: David Miller, netdev, jiri

With this patch applied, I no longer experience the kernel warning messages.

Tested-by: Chris Healy <cphealy@gmail.com>

On Sun, Aug 16, 2020 at 12:27 PM Andrew Lunn <andrew@lunn.ch> wrote:
>
> It is possible to trigger this WARN_ON from user space by triggering a
> devlink snapshot with an ID which already exists. We don't need both
> -EEXISTS being reported and spamming the kernel log.
>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  net/core/devlink.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/core/devlink.c b/net/core/devlink.c
> index e674f0f46dc2..e5feb87beca7 100644
> --- a/net/core/devlink.c
> +++ b/net/core/devlink.c
> @@ -4063,7 +4063,7 @@ static int __devlink_snapshot_id_insert(struct devlink *devlink, u32 id)
>  {
>         lockdep_assert_held(&devlink->lock);
>
> -       if (WARN_ON(xa_load(&devlink->snapshot_ids, id)))
> +       if (xa_load(&devlink->snapshot_ids, id))
>                 return -EEXIST;
>
>         return xa_err(xa_store(&devlink->snapshot_ids, id, xa_mk_value(0),
> --
> 2.28.0
>

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

* Re: [PATCH] net: devlink: Remove overzealous WARN_ON with snapshots
  2020-08-16 19:26 [PATCH] net: devlink: Remove overzealous WARN_ON with snapshots Andrew Lunn
  2020-08-16 19:39 ` Andrew Lunn
  2020-08-16 21:21 ` Chris Healy
@ 2020-08-17  4:07 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-08-17  4:07 UTC (permalink / raw)
  To: andrew; +Cc: netdev, cphealy, jiri

From: Andrew Lunn <andrew@lunn.ch>
Date: Sun, 16 Aug 2020 21:26:38 +0200

> It is possible to trigger this WARN_ON from user space by triggering a
> devlink snapshot with an ID which already exists. We don't need both
> -EEXISTS being reported and spamming the kernel log.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>

Applied, thanks Andrew.

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

end of thread, other threads:[~2020-08-17  4:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-16 19:26 [PATCH] net: devlink: Remove overzealous WARN_ON with snapshots Andrew Lunn
2020-08-16 19:39 ` Andrew Lunn
2020-08-16 21:21 ` Chris Healy
2020-08-17  4:07 ` David Miller

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).