]> www.infradead.org Git - users/jedix/linux-maple.git/commit
md: multipath: don't hardcopy bio in .make_request path
authorMing Lei <ming.lei@canonical.com>
Sat, 12 Mar 2016 01:29:40 +0000 (09:29 +0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 26 May 2016 22:46:27 +0000 (15:46 -0700)
commit511a3b6de14122f28f08dd682293db025c419835
treeeec049ab7c28dcce32d5dbcedffae77f92c11fd3
parent133e9043ab6033388f3da0be2b9de332f1888e7a
md: multipath: don't hardcopy bio in .make_request path

Orabug: 23331114

[ Upstream commit fafcde3ac1a418688a734365203a12483b83907a ]

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.

Cc: stable@vger.kernel.org (v3.14+)
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: Sasha Levin <sasha.levin@oracle.com>
(cherry picked from commit 79deb9b280a508c77f6cc233e083544712bc2458)

Signed-off-by: Dan Duval <dan.duval@oracle.com>
drivers/md/multipath.c