Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: John Garry <john.g.garry@oracle.com>,
	Nilay Shroff <nilay@linux.ibm.com>,
	Mikulas Patocka <mpatocka@redhat.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Jens Axboe <axboe@kernel.dk>, Sasha Levin <sashal@kernel.org>,
	agk@redhat.com, snitzer@kernel.org, dm-devel@lists.linux.dev
Subject: [PATCH AUTOSEL 6.12 10/31] dm-stripe: limit chunk_sectors to the stripe size
Date: Sun,  3 Aug 2025 17:19:13 -0400	[thread overview]
Message-ID: <20250803211935.3547048-10-sashal@kernel.org> (raw)
In-Reply-To: <20250803211935.3547048-1-sashal@kernel.org>

From: John Garry <john.g.garry@oracle.com>

[ Upstream commit 5fb9d4341b782a80eefa0dc1664d131ac3c8885d ]

Same as done for raid0, set chunk_sectors limit to appropriately set the
atomic write size limit.

Setting chunk_sectors limit in this way overrides the stacked limit
already calculated based on the bottom device limits. This is ok, as
when any bios are sent to the bottom devices, the block layer will still
respect the bottom device chunk_sectors.

Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Reviewed-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20250711105258.3135198-6-john.g.garry@oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

Based on my analysis of the commit and the kernel repository context,
here is my assessment:

**Backport Status: YES**

This commit should be backported to stable kernel trees for the
following reasons:

1. **Bug Fix**: This commit fixes a correctness issue where dm-stripe
   was not properly setting the `chunk_sectors` limit. The commit
   message explains that this is needed to "appropriately set the atomic
   write size limit." Without this fix, atomic writes on dm-stripe
   devices may not work correctly or may have incorrect size limits.


3. **Small and Contained**: The change is minimal - just a single line
   addition:
  ```c
  limits->chunk_sectors = sc->chunk_size;
  ```
  This sets the chunk_sectors field in the io_hints function, which is a
  straightforward fix with minimal risk.

4. **Fixes Regression/Incorrect Behavior**: The block layer commit
   `add194b01e4a` shows that the stacking code now relies on
   `chunk_sectors` instead of `io_min` to determine atomic write limits.
   Without this dm-stripe fix, atomic writes would be incorrectly
   limited or potentially fail on dm-stripe devices because the
   chunk_sectors field would be unset.

5. **No New Features**: This doesn't add new functionality - it simply
   ensures that an existing feature (atomic writes, enabled by commit
   `30b88ed06f80`) works correctly by providing the required
   chunk_sectors information.

6. **Clear Dependencies**: The commit is self-contained and only depends
   on the atomic writes infrastructure already being present
   (DM_TARGET_ATOMIC_WRITES flag), which was added earlier.

The fix addresses a real issue where atomic write operations on dm-
stripe devices would have incorrect size limits because the block layer
stacking code expects chunk_sectors to be set but dm-stripe wasn't
providing this value. This is exactly the type of bug fix that stable
kernels should receive - it's small, fixes incorrect behavior, and has
minimal risk of introducing regressions.

 drivers/md/dm-stripe.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c
index 4112071de0be..c68dc1653cfd 100644
--- a/drivers/md/dm-stripe.c
+++ b/drivers/md/dm-stripe.c
@@ -459,6 +459,7 @@ static void stripe_io_hints(struct dm_target *ti,
 	struct stripe_c *sc = ti->private;
 	unsigned int chunk_size = sc->chunk_size << SECTOR_SHIFT;
 
+	limits->chunk_sectors = sc->chunk_size;
 	limits->io_min = chunk_size;
 	limits->io_opt = chunk_size * sc->stripes;
 }
-- 
2.39.5


  parent reply	other threads:[~2025-08-03 21:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-03 21:19 [PATCH AUTOSEL 6.12 01/31] hfs: fix general protection fault in hfs_find_init() Sasha Levin
2025-08-03 21:19 ` [PATCH AUTOSEL 6.12 02/31] hfs: fix slab-out-of-bounds in hfs_bnode_read() Sasha Levin
2025-08-03 21:19 ` [PATCH AUTOSEL 6.12 03/31] hfsplus: fix slab-out-of-bounds in hfsplus_bnode_read() Sasha Levin
2025-08-03 21:19 ` [PATCH AUTOSEL 6.12 04/31] hfsplus: fix slab-out-of-bounds read in hfsplus_uni2asc() Sasha Levin
2025-08-03 21:19 ` [PATCH AUTOSEL 6.12 05/31] hfsplus: don't use BUG_ON() in hfsplus_create_attributes_file() Sasha Levin
2025-08-03 21:19 ` [PATCH AUTOSEL 6.12 06/31] arm64: Handle KCOV __init vs inline mismatches Sasha Levin
2025-08-03 21:19 ` [PATCH AUTOSEL 6.12 07/31] firmware: arm_ffa: Change initcall level of ffa_init() to rootfs_initcall Sasha Levin
2025-08-03 21:19 ` [PATCH AUTOSEL 6.12 08/31] smb/server: avoid deadlock when linking with ReplaceIfExists Sasha Levin
2025-08-03 21:19 ` [PATCH AUTOSEL 6.12 09/31] nvme-pci: try function level reset on init failure Sasha Levin
2025-08-03 21:19 ` Sasha Levin [this message]
2025-08-03 21:19 ` [PATCH AUTOSEL 6.12 11/31] md/raid10: set chunk_sectors limit Sasha Levin
2025-08-03 21:19 ` [PATCH AUTOSEL 6.12 12/31] nvme-tcp: log TLS handshake failures at error level Sasha Levin
2025-08-03 21:19 ` [PATCH AUTOSEL 6.12 13/31] gfs2: Validate i_depth for exhash directories Sasha Levin
2025-08-03 21:19 ` [PATCH AUTOSEL 6.12 14/31] gfs2: Set .migrate_folio in gfs2_{rgrp,meta}_aops Sasha Levin
2025-08-03 21:19 ` [PATCH AUTOSEL 6.12 15/31] md: call del_gendisk in control path Sasha Levin
2025-08-03 21:19 ` [PATCH AUTOSEL 6.12 16/31] loop: Avoid updating block size under exclusive owner Sasha Levin
2025-08-03 21:19 ` [PATCH AUTOSEL 6.12 17/31] udf: Verify partition map count Sasha Levin
2025-08-03 21:19 ` [PATCH AUTOSEL 6.12 18/31] drbd: add missing kref_get in handle_write_conflicts Sasha Levin
2025-08-03 21:19 ` [PATCH AUTOSEL 6.12 19/31] hfs: fix not erasing deleted b-tree node issue Sasha Levin
2025-08-03 21:19 ` [PATCH AUTOSEL 6.12 20/31] better lockdep annotations for simple_recursive_removal() Sasha Levin
2025-08-03 21:19 ` [PATCH AUTOSEL 6.12 21/31] ata: ahci: Disallow LPM policy control if not supported Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250803211935.3547048-10-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=agk@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@lists.linux.dev \
    --cc=john.g.garry@oracle.com \
    --cc=martin.petersen@oracle.com \
    --cc=mpatocka@redhat.com \
    --cc=nilay@linux.ibm.com \
    --cc=patches@lists.linux.dev \
    --cc=snitzer@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox