Commit 111ee63e authored by Damien Le Moal's avatar Damien Le Moal Committed by Bart Van Assche
Browse files

FROMGIT: dm: Check for forbidden splitting of zone write operations



DM targets must not split zone append and write operations using
dm_accept_partial_bio() as doing so is forbidden for zone append BIOs,
breaks zone append emulation using regular write BIOs and potentially
creates deadlock situations with queue freeze operations.

Modify dm_accept_partial_bio() to add missing BUG_ON() checks for all
these cases, that is, check that the BIO is a write or write zeroes
operation. This change packs all the zone related checks together under
a static_branch_unlikely(&zoned_enabled) and done only if the target is
a zoned device.

Fixes: f211268e ("dm: Use the block layer zone append emulation")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarDamien Le Moal <dlemoal@kernel.org>
Reviewed-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Link: https://lore.kernel.org/r/20250625093327.548866-6-dlemoal@kernel.org


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Bug: 417517944
(cherry picked from commit e04a33a18fdb259d7ad3673ddfce6112f5ce30fd git://git.kernel.dk/linux-block

 for-next)
Change-Id: I0f4183e1d2aa9ec09cd7824a315a2c382a185497
Signed-off-by: default avatarBart Van Assche <bvanassche@google.com>
parent 177d6611
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment