[Devel] [PATCH RH8 22/61] ploop: Move remap_to_origin()

Kirill Tkhai ktkhai at virtuozzo.com
Fri May 14 18:56:34 MSK 2021


Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/md/dm-ploop-map.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
index 914e298305a8..389d835fcf79 100644
--- a/drivers/md/dm-ploop-map.c
+++ b/drivers/md/dm-ploop-map.c
@@ -493,7 +493,6 @@ static void handle_discard_bio(struct ploop *ploop, struct bio *bio,
 	read_unlock_irq(&ploop->bat_rwlock);
 	atomic_inc(&ploop->nr_discard_bios);
 
-	remap_to_origin(ploop, bio);
 	remap_to_cluster(ploop, h, dst_cluster);
 
 	pos = to_bytes(h->bi_iter.bi_sector);
@@ -1319,7 +1318,6 @@ static void submit_rw_mapped(struct ploop *ploop, loff_t clu_pos, struct pio *pi
 	iov_iter_bvec(&iter, rw, bvec, nr_segs, pio->bi_iter.bi_size);
 	iter.iov_offset = pio->bi_iter.bi_bvec_done;
 
-	remap_to_origin(ploop, bio);
 	remap_to_cluster(ploop, pio, clu_pos);
 	pos = to_bytes(pio->bi_iter.bi_sector);
 
@@ -1653,6 +1651,8 @@ int ploop_map(struct dm_target *ti, struct bio *bio)
 
 	ploop_init_end_io(ploop, bio);
 
+	remap_to_origin(ploop, bio);
+
 	pio->bi_iter = bio->bi_iter;
 	pio->bi_io_vec = bio->bi_io_vec;
 	pio->bi_opf = bio->bi_opf;




More information about the Devel mailing list