Shin'ichiro Kawasaki 92b914e29a dm: fix bio length of empty flush
The commit 92986f6b4c8a ("dm: use bio_clone_fast in alloc_io/alloc_tio")
removed bio_clone_fast() call from alloc_tio() when ci->io->tio is
available. In this case, ci->bio is not copied to ci->io->tio.clone.
This is fine since init_clone_info() sets same values to ci->bio and
ci->io->tio.clone.

However, when incoming bios have REQ_PREFLUSH flag, __send_empty_flush()
prepares a zero length bio on stack and set it to ci->bio. At this time,
ci->io->tio.clone still keeps non-zero length. When alloc_tio() chooses
this ci->io->tio.clone as the bio to map, it is passed to targets as
non-empty flush bio. It causes bio length check failure in dm-zoned and
unexpected operation such as dm_accept_partial_bio() call.

To avoid the non-empty flush bio, set zero length to ci->io->tio.clone
in __send_empty_flush().

Fixes: 92986f6b4c8a ("dm: use bio_clone_fast in alloc_io/alloc_tio")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
2022-04-15 16:16:09 -04:00
..
2022-03-28 12:41:28 -07:00
2022-03-02 12:15:54 -05:00
2022-03-24 19:37:53 -07:00
2022-03-24 19:37:53 -07:00
2022-03-24 19:37:53 -07:00
2022-03-24 19:37:53 -07:00
2022-03-24 19:37:53 -07:00
2022-04-15 16:16:09 -04:00
2021-12-04 08:58:51 -08:00
2022-01-06 08:37:03 -08:00
2022-03-24 19:37:53 -07:00
2022-03-21 17:16:01 -07:00
2022-02-22 21:11:08 -05:00
2022-02-22 21:11:08 -05:00
2022-03-08 15:16:54 -08:00
2022-03-26 11:51:46 -07:00
2022-03-08 15:16:54 -08:00
2019-03-12 10:15:18 -07:00
2022-03-26 11:51:46 -07:00
2022-03-26 11:51:46 -07:00
2022-01-06 08:37:02 -08:00
2022-03-24 19:37:53 -07:00
2022-03-08 15:16:54 -08:00