From: Andrew Lunn Date: Sun, 16 Aug 2020 19:26:38 +0000 (+0200) Subject: net: devlink: Remove overzealous WARN_ON with snapshots X-Git-Tag: v5.15~3062^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bd71ea60673180eccf17b1a1dda3504a04783789;p=platform%2Fkernel%2Flinux-starfive.git net: devlink: Remove overzealous WARN_ON with snapshots 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 Tested-by: Chris Healy Signed-off-by: David S. Miller --- diff --git a/net/core/devlink.c b/net/core/devlink.c index e674f0f4..e5feb87 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),