dm-stats: fix merge accounting

There were wrong parentheses when setting stats_aux->merged, so that
merging was never properly accounted. This commit fixes it.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Assisted-by: Claude:claude-opus-4-6
Fixes: fd2ed4d252 ("dm: add statistics support")
Cc: stable@vger.kernel.org
This commit is contained in:
Mikulas Patocka
2026-07-10 18:35:49 +02:00
parent 422f1d4f14
commit 1917eb2db7

View File

@@ -692,10 +692,8 @@ void dm_stats_account_io(struct dm_stats *stats, unsigned long bi_rw,
*/
last = raw_cpu_ptr(stats->last);
stats_aux->merged =
(bi_sector == (READ_ONCE(last->last_sector) &&
((bi_rw == WRITE) ==
(READ_ONCE(last->last_rw) == WRITE))
));
bi_sector == READ_ONCE(last->last_sector) &&
(bi_rw == WRITE) == (READ_ONCE(last->last_rw) == WRITE);
WRITE_ONCE(last->last_sector, end_sector);
WRITE_ONCE(last->last_rw, bi_rw);
} else