From patchwork Sun Mar 17 10:01:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 10856253 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F34CC15AC for ; Sun, 17 Mar 2019 10:03:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE49E2966F for ; Sun, 17 Mar 2019 10:03:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D27AA29678; Sun, 17 Mar 2019 10:03:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7F48C2966F for ; Sun, 17 Mar 2019 10:03:36 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h5Sbm-0004H9-1q; Sun, 17 Mar 2019 10:01:34 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h5Sbk-0004H4-Ik for xen-devel@lists.xenproject.org; Sun, 17 Mar 2019 10:01:32 +0000 X-Inumbo-ID: a3dd2f52-489b-11e9-bc90-bc764e045a96 Received: from mx1.redhat.com (unknown [209.132.183.28]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id a3dd2f52-489b-11e9-bc90-bc764e045a96; Sun, 17 Mar 2019 10:01:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7C1CB3002074; Sun, 17 Mar 2019 10:01:31 +0000 (UTC) Received: from localhost (ovpn-8-17.pek2.redhat.com [10.72.8.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 92E985C6C1; Sun, 17 Mar 2019 10:01:28 +0000 (UTC) From: Ming Lei To: Jens Axboe Date: Sun, 17 Mar 2019 18:01:04 +0800 Message-Id: <20190317100112.8106-3-ming.lei@redhat.com> In-Reply-To: <20190317100112.8106-1-ming.lei@redhat.com> References: <20190317100112.8106-1-ming.lei@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Sun, 17 Mar 2019 10:01:31 +0000 (UTC) Subject: [Xen-devel] [PATCH V2 02/10] block: avoid to break XEN by multi-page bvec X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Ming Lei , linux-block@vger.kernel.org, xen-devel@lists.xenproject.org, ris Ostrovsky , Christoph Hellwig , Omar Sandoval MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP XEN has special page merge requirement, see xen_biovec_phys_mergeable(). We can't merge pages into one bvec simply for XEN. So move XEN's specific check on page merge into __bio_try_merge_page(), then abvoid to break XEN by multi-page bvec. Cc: ris Ostrovsky Cc: Juergen Gross Cc: xen-devel@lists.xenproject.org Cc: Omar Sandoval Cc: Christoph Hellwig Signed-off-by: Ming Lei Reviewed-by: Juergen Gross --- block/bio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/bio.c b/block/bio.c index 71a78d9fb8b7..d8f48188937c 100644 --- a/block/bio.c +++ b/block/bio.c @@ -776,6 +776,8 @@ bool __bio_try_merge_page(struct bio *bio, struct page *page, if (vec_end_addr + 1 != page_addr + off) return false; + if (xen_domain() && !xen_biovec_phys_mergeable(bv, page)) + return false; if (same_page && (vec_end_addr & PAGE_MASK) != page_addr) return false;