]> www.infradead.org Git - users/jedix/linux-maple.git/commit
block: Ensure start sector is aligned for stacking atomic writes
authorJohn Garry <john.g.garry@oracle.com>
Thu, 9 Jan 2025 11:39:59 +0000 (11:39 +0000)
committerJens Axboe <axboe@kernel.dk>
Wed, 15 Jan 2025 16:47:43 +0000 (09:47 -0700)
commit6564862d646e7d630929ba1ff330740bb215bdac
tree2bb7b407a234a226c6ec07673d876d4fb779c248
parent659381520a3b13403c3051516317adc02e48259b
block: Ensure start sector is aligned for stacking atomic writes

For stacking atomic writes, ensure that the start sector is aligned with
the device atomic write unit min and any boundary. Otherwise, we may
permit misaligned atomic writes.

Rework bdev_can_atomic_write() into a common helper to resuse the
alignment check. There also use atomic_write_hw_unit_min, which is more
proper (than atomic_write_unit_min).

Fixes: d7f36dc446e89 ("block: Support atomic writes limits for stacked devices")
Reviewed-by: Christoph Hellwig <hch@lst.de>
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/20250109114000.2299896-2-john.g.garry@oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-settings.c
include/linux/blkdev.h