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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT 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 EFB2EC43381 for ; Tue, 26 Mar 2019 02:16:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BC48820823 for ; Tue, 26 Mar 2019 02:16:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730533AbfCZCQm (ORCPT ); Mon, 25 Mar 2019 22:16:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6112 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727427AbfCZCQl (ORCPT ); Mon, 25 Mar 2019 22:16:41 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B8D3E307D846; Tue, 26 Mar 2019 02:16:41 +0000 (UTC) Received: from ming.t460p (ovpn-8-21.pek2.redhat.com [10.72.8.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 19FB01001E7E; Tue, 26 Mar 2019 02:16:33 +0000 (UTC) Date: Tue, 26 Mar 2019 10:16:28 +0800 From: Ming Lei To: Sagi Grimberg Cc: Christoph Hellwig , linux-nvme@lists.infradead.org, Yi Zhang , stable@vger.kernel.org, Chaitanya Kulkarni Subject: Re: [PATCH 1/2] nvme: target: fix nvmet_file_init_bvec() Message-ID: <20190326021627.GE30669@ming.t460p> References: <20190325100708.24172-1-ming.lei@redhat.com> <20190325100708.24172-2-ming.lei@redhat.com> <20190325105231.GA24907@lst.de> <20190326013935.GC30669@ming.t460p> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 26 Mar 2019 02:16:41 +0000 (UTC) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Mon, Mar 25, 2019 at 07:03:23PM -0700, Sagi Grimberg wrote: > > > > The scatterlist in the nvme target is always allocated by the nvmet > > > code itself an thus never contains multi-page sg list entries. > > > > I am wondering if it is true. > > > > Not look at other target code yet, however seems it isn't true for loop, > > see the following code in nvme_loop_queue_rq(): > > > > iod->req.sg = iod->sg_table.sgl; > > iod->req.sg_cnt = blk_rq_map_sg(req->q, req, iod->sg_table.sgl); > > iod->req.transfer_len = blk_rq_payload_bytes(req); > > > > And it has been triggered by nvme/011 in Yi's test. > > Yes, loop is an exception in this case. Thanks for the clarification! Another candidate fix is to set nvmet-loop's queue segment boundary mask as PAGE_SIZE - 1. Also there is the same issue for block device backed target. If no one objects, I'd like to take the approach of adjusting segment boundary mask. Thanks, Ming