Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CADB33B4E9B; Tue, 21 Jul 2026 20:56:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784667414; cv=none; b=BViCJn+a4cFA+0Kh2q/JN+EvIrXHRuwnf0c4bWxM6U0/zC4AnkIRl4kU5yAKNGuSH2i/9ulgHw3qCFGsNfSZL/cK6bzY4IwkuCBBFpSbtaJczJyWvvHdej8r0xePTiI+Vy5Be2RTfxie+VxzzYZeBp+9iNSEgclgKeH5dj4aphU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784667414; c=relaxed/simple; bh=9MeRKxmv+Zn0FqQWYTo96SMVGXFwtkWwWDyaBawsOOM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nm1+GtomA1OOk0rh9X4GPJoYRfk0N/X2kFZ1rLpOxBFt9i2gEsVb3IE71IiO+enIZmhfPe2P019Qr6svKvonsAEZwzmKj4OKsvEV3NL1Ny125Q/5ddECqMmNhR0K4yvIfhu5JnKIKf13sILsniJZeDc+AfSTxb3BMIkSc1w240M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=bqO45nDJ; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="bqO45nDJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 362881F00A3A; Tue, 21 Jul 2026 20:56:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784667413; bh=KP6Ktm7CxXJLwOboWwcnXi9Xd1eEfsV9Qil2t8hwcTk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=bqO45nDJSXkIPnGxUZnT+qPfp+IV8+y9Vg3KX/6DKshz4lUzBDxNW6bbN/z3+LmSB eyboTxChBAU7TAuKUznicHPlkVA2kMGWDZHh6JfKVdb0r2f0lSk4SHqracyjU2mH4m PiM11e5lnIsdJb8qIgqhRFKkvgqL+0+uQTfVYbxc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mikulas Patocka Subject: [PATCH 6.6 1051/1266] dm-stats: fix merge accounting Date: Tue, 21 Jul 2026 17:24:48 +0200 Message-ID: <20260721152505.335726072@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152441.786066624@linuxfoundation.org> References: <20260721152441.786066624@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mikulas Patocka commit 1917eb2db750ecbdf710f79a8042eaa545a063c7 upstream. 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 Assisted-by: Claude:claude-opus-4-6 Fixes: fd2ed4d25270 ("dm: add statistics support") Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-stats.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/drivers/md/dm-stats.c +++ b/drivers/md/dm-stats.c @@ -683,10 +683,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