xfs: bump lost_prev_errors if we lose even the healthmon lost event

LOLLM observes that we don't bump xfs_healthmon::lost_prev_event even if
we can't allocate or queue a LOST event, which means that events can
disappear silently when things are going very wrong.  Bump the counter
to avoid this problem.

Cc: stable@vger.kernel.org # v7.0
Fixes: b3a289a2a9 ("xfs: create event queuing, formatting, and discovery infrastructure")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
Darrick J. Wong 2026-09-01 22:47:59 -07:00 committed by Carlos Maiolino
parent 74eeb68a62
commit 295f2cfd3e

View File

@ -326,8 +326,10 @@ xfs_healthmon_clear_lost_prev(
if (hm->events < XFS_HEALTHMON_MAX_EVENTS)
event = kmemdup(&lost_event, sizeof(struct xfs_healthmon_event),
GFP_NOFS);
if (!event)
if (!event) {
xfs_healthmon_bump_lost(hm);
return -ENOMEM;
}
__xfs_healthmon_insert(hm, INSERT_TAIL, event);
cleared: