History

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.

Mikulas Patocka committed 4 months ago

Commit 1917eb21 parent 422f1d41 file · +2 −4Browse files

Unified · Split

drivers/md/dm-stats.c+2−4
@@ -692,10 +692,8 @@ void dm_stats_account_io(struct dm_stats *stats, unsigned long bi_rw, · 691 unmodified lines
692692 */
693693 last = raw_cpu_ptr(stats->last);
694694 stats_aux->merged =
695− (bi_sector == (READ_ONCE(last->last_sector) &&
696− ((bi_rw == WRITE) ==
697− (READ_ONCE(last->last_rw) == WRITE))
698− ));
695+ bi_sector == READ_ONCE(last->last_sector) &&
696+ (bi_rw == WRITE) == (READ_ONCE(last->last_rw) == WRITE);
699697 WRITE_ONCE(last->last_sector, end_sector);
700698 WRITE_ONCE(last->last_rw, bi_rw);
701699 } else