From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70944C43381 for ; Tue, 26 Mar 2019 03:19:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 41E3C2083D for ; Tue, 26 Mar 2019 03:19:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730808AbfCZDTo (ORCPT ); Mon, 25 Mar 2019 23:19:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50096 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730717AbfCZDTo (ORCPT ); Mon, 25 Mar 2019 23:19:44 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 60968309265F; Tue, 26 Mar 2019 03:19:44 +0000 (UTC) Received: from localhost (ovpn-8-21.pek2.redhat.com [10.72.8.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8366783867; Tue, 26 Mar 2019 03:19:43 +0000 (UTC) From: Ming Lei To: linux-nvme@lists.infradead.org, Christoph Hellwig Cc: Ming Lei , Yi Zhang , Sagi Grimberg , Chaitanya Kulkarni , stable@vger.kernel.org Subject: [PATCH 1/4] nvmet: set loop queue's segment boundary mask as PAGE_SIZE - 1 Date: Tue, 26 Mar 2019 11:19:25 +0800 Message-Id: <20190326031928.9499-2-ming.lei@redhat.com> In-Reply-To: <20190326031928.9499-1-ming.lei@redhat.com> References: <20190326031928.9499-1-ming.lei@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 26 Mar 2019 03:19:44 +0000 (UTC) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org NVMe target only accepts single-page sg list, either file or block device backed target code follows this assumption. However, loop target is one exception, given the sg list is from the host queue directly. This patch sets loop queue's segment boundary mask as PAGE_SIZE - 1 for folowoing NVMe target assumption. Reported-by: Yi Zhang Fixes: 3a85a5de29ea ("nvme-loop: add a NVMe loopback host driver") Cc: Yi Zhang Cc: Sagi Grimberg Cc: Chaitanya Kulkarni Cc: Signed-off-by: Ming Lei --- drivers/nvme/target/loop.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c index b9f623ab01f3..7194f86b9dac 100644 --- a/drivers/nvme/target/loop.c +++ b/drivers/nvme/target/loop.c @@ -549,6 +549,9 @@ static int nvme_loop_create_io_queues(struct nvme_loop_ctrl *ctrl) if (ret) goto out_cleanup_connect_q; + /* target only accepts single-page sg list */ + blk_queue_segment_boundary(ctrl->ctrl.connect_q, PAGE_SIZE - 1); + return 0; out_cleanup_connect_q: -- 2.9.5