devlink: Hold devlink lock on health reporter dump get
authorMoshe Shemesh <moshe@nvidia.com>
Thu, 5 Oct 2023 12:50:16 +0000 (15:50 +0300)
committerJakub Kicinski <kuba@kernel.org>
Fri, 6 Oct 2023 22:56:46 +0000 (15:56 -0700)
commitaba0e909dc20eceb1de985474af459f82e7b0b82
treeabc4cd4704db73c3d8702c7025f6851ca28fef6c
parentc4d49196ceec80e30e8d981410d73331b49b7850
devlink: Hold devlink lock on health reporter dump get

Devlink health dump get callback should take devlink lock as any other
devlink callback. Otherwise, since devlink_mutex was removed, this
callback is not protected from a race of the reporter being destroyed
while handling the callback.

Add devlink lock to the callback and to any call for
devlink_health_do_dump(). This should be safe as non of the drivers dump
callback implementation takes devlink lock.

As devlink lock is added to any callback of dump, the reporter dump_lock
is now redundant and can be removed.

Fixes: d3efc2a6a6d8 ("net: devlink: remove devlink_mutex")
Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Link: https://lore.kernel.org/r/1696510216-189379-1-git-send-email-moshe@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/devlink/health.c