From febf71588c2a750e04dc2a8b0824ce120c48bd9e Mon Sep 17 00:00:00 2001 From: Keith Busch Date: Fri, 17 Oct 2014 17:46:35 -0600 Subject: block: require blk_rq_prep_clone() be given an initialized clone request Prepare to allow blk_rq_prep_clone() to accept clone requests that were allocated from blk-mq request queues. As such the blk_rq_prep_clone() caller must first initialize the clone request. Signed-off-by: Keith Busch Signed-off-by: Mike Snitzer Signed-off-by: Jens Axboe --- drivers/md/dm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/md/dm.c') diff --git a/drivers/md/dm.c b/drivers/md/dm.c index b98cd9d84435..f251633a51af 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1719,6 +1719,7 @@ static int setup_clone(struct request *clone, struct request *rq, { int r; + blk_rq_init(NULL, rq); r = blk_rq_prep_clone(clone, rq, tio->md->bs, GFP_ATOMIC, dm_rq_bio_constructor, tio); if (r) -- cgit v1.2.1 From db507b3ffd9b7a1c87e732ac6e2c3a5d0babb15a Mon Sep 17 00:00:00 2001 From: Mike Snitzer Date: Mon, 9 Feb 2015 12:21:54 -0500 Subject: dm: fix multipath regression due to initializing wrong request Commit febf715 ("block: require blk_rq_prep_clone() be given an initialized clone request") introduced a regression by calling blk_rq_init() on the original request rather than the clone request that is passed to setup_clone(). Signed-off-by: Mike Snitzer Fixes: febf71588c2a ("block: require blk_rq_prep_clone() be given an initialized clone request") Signed-off-by: Jens Axboe --- drivers/md/dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/md/dm.c') diff --git a/drivers/md/dm.c b/drivers/md/dm.c index f251633a51af..71e6b73fe78d 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1719,7 +1719,7 @@ static int setup_clone(struct request *clone, struct request *rq, { int r; - blk_rq_init(NULL, rq); + blk_rq_init(NULL, clone); r = blk_rq_prep_clone(clone, rq, tio->md->bs, GFP_ATOMIC, dm_rq_bio_constructor, tio); if (r) -- cgit v1.2.1