Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932487AbbDUPek (ORCPT ); Tue, 21 Apr 2015 11:34:40 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:57579 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932434AbbDUPee (ORCPT ); Tue, 21 Apr 2015 11:34:34 -0400 From: Luis Henriques To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Wenbo Wang , Jens Axboe , Luis Henriques Subject: [PATCH 3.16.y-ckt 092/144] Fix bug in blk_rq_merge_ok Date: Tue, 21 Apr 2015 16:31:17 +0100 Message-Id: <1429630329-21748-93-git-send-email-luis.henriques@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1429630329-21748-1-git-send-email-luis.henriques@canonical.com> References: <1429630329-21748-1-git-send-email-luis.henriques@canonical.com> X-Extended-Stable: 3.16 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1392 Lines: 38 3.16.7-ckt10 -stable review patch. If anyone has any objections, please let me know. ------------------ From: Wenbo Wang commit 7ee8e4f3983c4ff700958a6099c8fd212ea67b94 upstream. Use the right array index to reference the last element of rq->biotail->bi_io_vec[] Signed-off-by: Wenbo Wang Reviewed-by: Chong Yuan Fixes: 66cb45aa41315 ("block: add support for limiting gaps in SG lists") Signed-off-by: Jens Axboe Signed-off-by: Luis Henriques --- block/blk-merge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-merge.c b/block/blk-merge.c index 54535831f1e1..25db382fd2c2 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -596,7 +596,7 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio) if (q->queue_flags & (1 << QUEUE_FLAG_SG_GAPS)) { struct bio_vec *bprev; - bprev = &rq->biotail->bi_io_vec[bio->bi_vcnt - 1]; + bprev = &rq->biotail->bi_io_vec[rq->biotail->bi_vcnt - 1]; if (bvec_gap_to_prev(bprev, bio->bi_io_vec[0].bv_offset)) return false; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/