From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752447AbcBOIXD (ORCPT ); Mon, 15 Feb 2016 03:23:03 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:33691 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752280AbcBOIXA (ORCPT ); Mon, 15 Feb 2016 03:23:00 -0500 Subject: Re: [PATCH 2/4] block: check virt boundary in bio_will_gap() To: Ming Lei , Jens Axboe , linux-kernel@vger.kernel.org References: <1455519687-23873-1-git-send-email-ming.lei@canonical.com> <1455519687-23873-3-git-send-email-ming.lei@canonical.com> Cc: linux-block@vger.kernel.org, Christoph Hellwig From: Sagi Grimberg Message-ID: <56C18AE1.9020201@dev.mellanox.co.il> Date: Mon, 15 Feb 2016 10:22:57 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1455519687-23873-3-git-send-email-ming.lei@canonical.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h > index 4571ef1..b8ff6a3 100644 > --- a/include/linux/blkdev.h > +++ b/include/linux/blkdev.h > @@ -1388,7 +1388,7 @@ static inline bool bvec_gap_to_prev(struct request_queue *q, > static inline bool bio_will_gap(struct request_queue *q, struct bio *prev, > struct bio *next) > { > - if (!bio_has_data(prev)) > + if (!bio_has_data(prev) || !queue_virt_boundary(q)) > return false; Can we not do that? bvec_gap_to_prev is already checking the virt_boundary and I'd sorta like to keep the motivation to optimize bio_get_last_bvec() to be O(1).