]> 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)
commit5137946112f299cdd1eb59f57b57cb2be2714f26
tree45413c09e352562570d5ec21ad37441e117bc3c3
parent1524eda95cc12489e6e69e1077cda7f256601473
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: 5d4411954b01 ("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