[3.19.y-ckt stable] Patch "md: multipath: don't hardcopy bio in .make_request path" has been added to the 3.19.y-ckt tree
Kamal Mostafa
kamal at canonical.com
Sat Apr 2 00:50:37 UTC 2016
This is a note to let you know that I have just added a patch titled
md: multipath: don't hardcopy bio in .make_request path
to the linux-3.19.y-queue branch of the 3.19.y-ckt extended stable tree
which can be found at:
http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.19.y-queue
This patch is scheduled to be released in version 3.19.8-ckt18.
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.19.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Kamal
---8<------------------------------------------------------------
>From b213482f95f8bb09b66a6fe33ee35057441f6e83 Mon Sep 17 00:00:00 2001
From: Ming Lei <ming.lei at canonical.com>
Date: Sat, 12 Mar 2016 09:29:40 +0800
Subject: md: multipath: don't hardcopy bio in .make_request path
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 at gmail.com>
Signed-off-by: Ming Lei <ming.lei at canonical.com>
Signed-off-by: Shaohua Li <shli at fb.com>
Signed-off-by: Kamal Mostafa <kamal at 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 399272f..2df218d 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
More information about the kernel-team
mailing list