]> git.baikalelectronics.ru Git - kernel.git/commit
dm: allow dm_accept_partial_bio() for dm_io without duplicate bios
authorMike Snitzer <snitzer@kernel.org>
Thu, 14 Apr 2022 15:52:54 +0000 (11:52 -0400)
committerMike Snitzer <snitzer@kernel.org>
Fri, 15 Apr 2022 00:01:54 +0000 (20:01 -0400)
commit944523a07fdd20725a9d1b03893e175504634850
tree1383e1cbfb0755d97b8fabca747438d374f5b03a
parentdf445aa6e4a7a727a09ac8b507034935a59b8f78
dm: allow dm_accept_partial_bio() for dm_io without duplicate bios

The intent behind commit 17737b8c33a7 ("dm: flag clones created by
__send_duplicate_bios") was to formally disallow the use of
dm_accept_partial_bio() where it simply isn't possible -- due to
constraint that multiple bios cannot meaningfully update a shared
tio->len_ptr.

But that commit went too far and disallowed the case where "abormal"
IO (e.g. WRITE_ZEROES) is only using a single bio.  Fix this by
not marking a dm_io with a single dm_target_io (and bio), that happens
to be created by __send_duplicate_bios, as DM_TIO_IS_DUPLICATE_BIO.
Also remove 'unsigned *len' parameter from alloc_multiple_bios().

This commit fixes a dm_accept_partial_bio() BUG_ON() with dm-zoned
when a WRITE_ZEROES bio is issued.

Fixes: 6ff7b693e3ae ("dm: switch dm_target_io booleans over to proper flags")
Reported-by: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
drivers/md/dm.c