Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: ming.lei@redhat.com (Ming Lei)
Subject: [PATCH 1/2] nvme: target: fix nvmet_file_init_bvec()
Date: Tue, 26 Mar 2019 09:39:36 +0800	[thread overview]
Message-ID: <20190326013935.GC30669@ming.t460p> (raw)
In-Reply-To: <20190325105231.GA24907@lst.de>

On Mon, Mar 25, 2019@11:52:31AM +0100, Christoph Hellwig wrote:
> On Mon, Mar 25, 2019@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

  reply	other threads:[~2019-03-26  1:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-25 10:07 [PATCH 0/2] nvme: target: build bvec from sg directly Ming Lei
2019-03-25 10:07 ` [PATCH 1/2] nvme: target: fix nvmet_file_init_bvec() Ming Lei
2019-03-25 10:52   ` Christoph Hellwig
2019-03-26  1:39     ` Ming Lei [this message]
2019-03-26  2:03       ` Sagi Grimberg
2019-03-26  2:16         ` Ming Lei
2019-03-26  7:32           ` Christoph Hellwig
2019-03-27 14:00   ` Sasha Levin
2019-03-25 10:07 ` [PATCH 2/2] nvme: target: build bvec from sg directly Ming Lei
2019-03-25 10:55   ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190326013935.GC30669@ming.t460p \
    --to=ming.lei@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox