]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: devlink: Remove overzealous WARN_ON with snapshots
authorAndrew Lunn <andrew@lunn.ch>
Sun, 16 Aug 2020 19:26:38 +0000 (21:26 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Aug 2020 04:07:06 +0000 (21:07 -0700)
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>
Tested-by: Chris Healy <cphealy@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/devlink.c

index e674f0f46dc2be64bc5b2b148004826ae3833dde..e5feb87beca7c48772ad07dec5777bd89c0d7947 100644 (file)
@@ -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),