Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1368590
| From | Kamal Mostafa <kamal@canonical.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 4.2.y-ckt 113/218] md: multipath: don't hardcopy bio in .make_request path |
| Date | 2016-03-31 22:20 +0200 |
| Message-ID | <riReq-1PN-11@gated-at.bofh.it> (permalink) |
| References | <riReq-1PN-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
4.2.8-ckt7 -stable review patch. If anyone has any objections, please let me know. ---8<------------------------------------------------------------ From: Ming Lei <ming.lei@canonical.com> commit fafcde3ac1a418688a734365203a12483b83907a upstream. Inside multipath_make_request(), multipath maps the incoming bio into low level device's bio, but it is totally wrong to copy the bio into mapped bio via '*mapped_bio = *bio'. For example, .__bi_remaining is kept in the copy, especially if the incoming bio is chained to via bio splitting, so .bi_end_io can't be called for the mapped bio at all in the completing path in this kind of situation. This patch fixes the issue by using clone style. Reported-and-tested-by: Andrea Righi <righi.andrea@gmail.com> Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Shaohua Li <shli@fb.com> Signed-off-by: Kamal Mostafa <kamal@canonical.com> --- drivers/md/multipath.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c index ac3ede2..ac37ef1 100644 --- a/drivers/md/multipath.c +++ b/drivers/md/multipath.c @@ -129,7 +129,9 @@ static void multipath_make_request(struct mddev *mddev, struct bio * bio) } multipath = conf->multipaths + mp_bh->path; - mp_bh->bio = *bio; + bio_init(&mp_bh->bio); + __bio_clone_fast(&mp_bh->bio, bio); + mp_bh->bio.bi_iter.bi_sector += multipath->rdev->data_offset; mp_bh->bio.bi_bdev = multipath->rdev->bdev; mp_bh->bio.bi_rw |= REQ_FAILFAST_TRANSPORT; -- 2.7.4
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 4.2.y-ckt 113/218] md: multipath: don't hardcopy bio in .make_request path Kamal Mostafa <kamal@canonical.com> - 2016-03-31 22:20 +0200
csiph-web