net/devlink: Move health recovery notification after abort check
Subsystems (3)
PATCH 1/1 net/devlink: Move health recovery notification after abort check
From: Li RongQing <[email protected]>
In devlink_health_report(), the DEVLINK_CMD_HEALTH_REPORTER_RECOVER notification is sent immediately after setting the error state, before checking if recovery should be aborted via devlink_health_recover_abort().
When devlink_health_recover_abort() returns true (e.g., due to rate limiting), the recovery process terminates early, but userspace has already received a notification implying that recovery is underway. This creates a misleading view of the reporter's activity.
Move the notification after the abort check, ensuring it is only sent when recovery will actually proceed. This aligns the notification with the actual recovery behavior.
--- net/devlink/health.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/devlink/health.c +1 -1
@@ -665,7 +665,6 @@ int devlink_health_report(struct devlink_health_reporter *reporter, reporter->error_count++; prev_health_state = reporter->health_state; reporter->health_state =DEVLINK_HEALTH_REPORTER_STATE_ERROR ; -devlink_recover_notify (reporter,DEVLINK_CMD_HEALTH_REPORTER_RECOVER );if (devlink_health_recover_abort (reporter, prev_health_state)) { trace_devlink_health_recover_aborted(devlink,
@@ -686,6 +685,7 @@ int devlink_health_report(struct devlink_health_reporter *reporter,if (!reporter->auto_recover)return 0 ; +devlink_recover_notify (reporter,DEVLINK_CMD_HEALTH_REPORTER_RECOVER );devl_lock (devlink); ret =devlink_health_reporter_recover (reporter, priv_ctx,NULL );devl_unlock (devlink);
Signature · 1 line
2.9.4
Paolo Abeni
maintainerQuoted 11 lines · lirongqing
From: Li RongQing <[email protected]>
In
devlink_health_report(), theDEVLINK_CMD_HEALTH_REPORTER_RECOVERnotification is sent immediately after setting the error state, before checking if recovery should be aborted viadevlink_health_recover_abort().When
devlink_health_recover_abort()returns true (e.g., due to rate limiting), the recovery process terminates early, but userspace has already received a notification implying that recovery is underway. This creates a misleading view of the reporter's activity.
Quoted 5 lines
Move the notification after the abort check, ensuring it is only sent when recovery will actually proceed. This aligns the notification with the actual recovery behavior.
Signed-off-by Li RongQing <[email protected]>
## Form letter - net-next-closed
We have already submitted our pull request with net-next material for v7.0, and therefore net-next is closed for new drivers, features, code refactoring and optimizations. We are currently accepting bug fixes only.
Please repost when net-next reopens after Feb 23rd.
RFC patches sent for review only are obviously welcome at any time.
See:
https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#development-cycle
Signature · 1 line
pw-bot: defer