xfs: don't merge different file IO error types

LOLLM noticed that we can accidentally merge file range health
monitoring events even if they have different errors.  We shouldn't do
that.

Cc: stable@vger.kernel.org # v7.0
Fixes: dfa8bad3a8 ("xfs: convey file I/O errors to the health monitor")
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-14 22:38:07 -07:00 committed by Carlos Maiolino
parent ab1c416d23
commit d80993655f

View File

@ -247,7 +247,9 @@ xfs_healthmon_merge_events(
case XFS_HEALTHMON_DIOWRITE:
case XFS_HEALTHMON_DATALOST:
/* logically adjacent file ranges can merge */
if (existing->fino != new->fino || existing->fgen != new->fgen)
if (existing->fino != new->fino ||
existing->fgen != new->fgen ||
existing->error != new->error)
return false;
if (existing->fpos + existing->flen == new->fpos) {