mirror of
https://github.com/torvalds/linux.git
synced 2026-10-23 23:51:02 +02:00
block: cap atomic write size by PI buffer size constraints
As Sashiko points out, limiting the I/O size by the size of the available
PI buffer can cause inconsistencies for atomic writes. This also limit
atomic_write_max_sectors in blk_validate_integrity_limits.
Fixes: ec7f31b2a2 ("block: make bio auto-integrity deadlock safe")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <mkp@kernel.org>
Link: https://patch.msgid.link/20260907074111.721054-3-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
d952f6acb7
commit
1418b5633c
|
|
@ -206,6 +206,12 @@ static int blk_validate_integrity_limits(struct queue_limits *lim)
|
|||
lim->max_sectors = min(lim->max_sectors,
|
||||
max_integrity_io_size(lim) >> SECTOR_SHIFT);
|
||||
|
||||
if (lim->features & BLK_FEAT_ATOMIC_WRITES) {
|
||||
lim->atomic_write_max_sectors =
|
||||
min(lim->atomic_write_max_sectors,
|
||||
max_integrity_io_size(lim) >> SECTOR_SHIFT);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user