[dm-devel] [PATCH] dm: clear BIO_SEG_VALID in clone_bio

yangerkun yangerkun at huawei.com
Thu Feb 14 09:19:30 UTC 2019


Since 57c36519e4("dm: fix clone_bio() to trigger blk_recount_segments()")
has been reverted by fa8db494("dm: don't use bio_trim() afterall"), the
problem that clone bio won't trigger blk_recount_segments will exits
again. So just clean the flag in clone_bio.

Fixes: fa8db4948f522("dm: don't use bio_trim() afterall")
Signed-off-by: yangerkun <yangerkun at huawei.com>
---
 drivers/md/dm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 515e6af..b22ac04 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1336,6 +1336,7 @@ static int clone_bio(struct dm_target_io *tio, struct bio *bio,
 			return r;
 	}
 
+	bio_clear_flag(clone, BIO_SEG_VALID);
 	bio_advance(clone, to_bytes(sector - clone->bi_iter.bi_sector));
 	clone->bi_iter.bi_size = to_bytes(len);
 
-- 
2.9.5




More information about the dm-devel mailing list