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 D329DC43381 for ; Tue, 26 Mar 2019 01:39:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ACA6A2075D for ; Tue, 26 Mar 2019 01:39:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730556AbfCZBju (ORCPT ); Mon, 25 Mar 2019 21:39:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34498 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727412AbfCZBju (ORCPT ); Mon, 25 Mar 2019 21:39:50 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D2C70308338E; Tue, 26 Mar 2019 01:39:49 +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 E2CBB5B6BF; Tue, 26 Mar 2019 01:39:41 +0000 (UTC) Date: Tue, 26 Mar 2019 09:39:36 +0800 From: Ming Lei To: Christoph Hellwig Cc: Yi Zhang , Sagi Grimberg , Chaitanya Kulkarni , stable@vger.kernel.org, linux-nvme@lists.infradead.org Subject: Re: [PATCH 1/2] nvme: target: fix nvmet_file_init_bvec() Message-ID: <20190326013935.GC30669@ming.t460p> References: <20190325100708.24172-1-ming.lei@redhat.com> <20190325100708.24172-2-ming.lei@redhat.com> <20190325105231.GA24907@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190325105231.GA24907@lst.de> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Tue, 26 Mar 2019 01:39:49 +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 11:52:31AM +0100, Christoph Hellwig wrote: > On Mon, Mar 25, 2019 at 06:07:07PM +0800, Ming Lei wrote: > > There isn't sg iterator helper for building bvec, so invent one > > and fix the issue in nvmet_file_init_bvec(). > > > > The issue is that one sg may include multipge continuous pages, and > > only the 1st .bv_offset isn't zero, also the length for the last bvec > > has to consider the remained length. > > 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. Thanks, Ming