From e6fc9f62ce6e412acb1699a5373174aa42ca2bd3 Mon Sep 17 00:00:00 2001 From: Mike Snitzer Date: Thu, 17 Feb 2022 23:40:30 -0500 Subject: dm: flag clones created by __send_duplicate_bios Formally disallow dm_accept_partial_bio() on clones created by __send_duplicate_bios() because their len_ptr points to a shared unsigned int. __send_duplicate_bios() is only used for flush bios and other "abnormal" bios (discards, writezeroes, etc). And dm_accept_partial_bio() already didn't support flush bios. Also refactor __send_changing_extent_only() to reflect it cannot fail. As such __send_changing_extent_only() can update the clone_info before __send_duplicate_bios() is called to fan-out __map_bio() calls. Reviewed-by: Mikulas Patocka Signed-off-by: Mike Snitzer --- drivers/md/dm-core.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/md/dm-core.h') diff --git a/drivers/md/dm-core.h b/drivers/md/dm-core.h index a86b5dacef0e..33ef92e90462 100644 --- a/drivers/md/dm-core.h +++ b/drivers/md/dm-core.h @@ -215,7 +215,8 @@ struct dm_target_io { struct dm_io *io; struct dm_target *ti; unsigned int *len_ptr; - bool inside_dm_io; + bool inside_dm_io:1; + bool is_duplicate_bio:1; sector_t old_sector; struct bio clone; }; -- cgit v1.2.3