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:
+2
-1
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user