]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
dm-stats: fix merge accounting
authorMikulas Patocka <mpatocka@redhat.com>
Fri, 10 Jul 2026 16:35:49 +0000 (18:35 +0200)
committerMikulas Patocka <mpatocka@redhat.com>
Fri, 10 Jul 2026 16:40:00 +0000 (18:40 +0200)
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: fd2ed4d25270 ("dm: add statistics support")
Cc: stable@vger.kernel.org
drivers/md/dm-stats.c

index c53cf07ab7b0b6885143ad972c56a394fb51c76b..e06374a3329e68bc464ec72af7917c3182e10644 100644 (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