]> git.baikalelectronics.ru Git - kernel.git/commit
devlink: ignore -EOPNOTSUPP errors on dumpit
authorJakub Kicinski <kuba@kernel.org>
Tue, 28 Jul 2020 23:15:07 +0000 (16:15 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Jul 2020 23:51:53 +0000 (16:51 -0700)
commit475b72f86d46e87a0327c7eeb5328569213cfcef
tree45413c09e352562570d5ec21ad37441e117bc3c3
parentc415183bc53555c2219d75d7e73dd7f8e422f598
devlink: ignore -EOPNOTSUPP errors on dumpit

Number of .dumpit functions try to ignore -EOPNOTSUPP errors.
Recent change missed that, and started reporting all errors
but -EMSGSIZE back from dumps. This leads to situation like
this:

$ devlink dev info
devlink answers: Operation not supported

Dump should not report an error just because the last device
to be queried could not provide an answer.

To fix this and avoid similar confusion make sure we clear
err properly, and not leave it set to an error if we don't
terminate the iteration.

Fixes: fc053f79e5e8 ("net: devlink: don't ignore errors during dumpit")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/devlink.c