Skip to content

Commit

Permalink
block: require blk_rq_prep_clone() be given an initialized clone request
Browse files Browse the repository at this point in the history
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 <keith.busch@intel.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Keith Busch authored and axboe committed Jan 28, 2015
1 parent 24391c0 commit febf715
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 0 additions & 2 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2945,8 +2945,6 @@ int blk_rq_prep_clone(struct request *rq, struct request *rq_src,
if (!bs)
bs = fs_bio_set;

blk_rq_init(NULL, rq);

__rq_for_each_bio(bio_src, rq_src) {
bio = bio_clone_fast(bio_src, gfp_mask, bs);
if (!bio)
Expand Down
1 change: 1 addition & 0 deletions drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit febf715

Please sign in to comment.