From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:50143 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755975AbcDJSAx (ORCPT ); Sun, 10 Apr 2016 14:00:53 -0400 Subject: Patch "md: multipath: don't hardcopy bio in .make_request path" has been added to the 3.14-stable tree To: ming.lei@canonical.com, gregkh@linuxfoundation.org, righi.andrea@gmail.com, shli@fb.com Cc: , From: Date: Sun, 10 Apr 2016 11:00:52 -0700 Message-ID: <1460311252199191@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled md: multipath: don't hardcopy bio in .make_request path to the 3.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: md-multipath-don-t-hardcopy-bio-in-.make_request-path.patch and it can be found in the queue-3.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From fafcde3ac1a418688a734365203a12483b83907a Mon Sep 17 00:00:00 2001 From: Ming Lei Date: Sat, 12 Mar 2016 09:29:40 +0800 Subject: md: multipath: don't hardcopy bio in .make_request path From: Ming Lei 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 Signed-off-by: Ming Lei Signed-off-by: Shaohua Li Signed-off-by: Greg Kroah-Hartman --- drivers/md/multipath.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/md/multipath.c +++ b/drivers/md/multipath.c @@ -131,7 +131,9 @@ static void multipath_make_request(struc } 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; Patches currently in stable-queue which might be from ming.lei@canonical.com are queue-3.14/md-multipath-don-t-hardcopy-bio-in-.make_request-path.patch