dm-stats: fix merge accounting
Mikulas Patocka
maintainerPATCH 1/1 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 <[email protected]>
Assisted-by Claude:claude-opus-4-6
Fixes fd2ed4d25270 ("dm: add statistics support")
--- drivers/md/dm-stats.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/md/dm-stats.c +2 -4
@@ -692,10 +692,8 @@ void dm_stats_account_io(struct dm_stats*/ 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