abd: Fix stats asymmetry in case of Direct I/O

abd_alloc_from_pages() does not call abd_update_scatter_stats(),
since memory is not really allocated there.  But abd_free_scatter()
called by abd_free() does.  It causes negative overflow of some
ABD and possibly ARC counters.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rob Norris <rob.norris@truenas.com>
Signed-off-by: Alexander Motin <alexander.motin@TrueNAS.com>
Closes #18390
This commit is contained in:
Alexander Motin
2026-04-01 10:28:18 -04:00
committed by GitHub
parent 869d805997
commit a22b3f6700
+2 -1
View File
@@ -280,7 +280,8 @@ static void
abd_free_scatter(abd_t *abd)
{
abd_free_chunks(abd);
abd_update_scatter_stats(abd, ABDSTAT_DECR);
if (!abd_is_from_pages(abd))
abd_update_scatter_stats(abd, ABDSTAT_DECR);
}
/*