From: ming.lei@redhat.com (Ming Lei)
Subject: [PATCH stable only] nvmet: set loop queue's segment boundary mask as PAGE_SIZE - 1
Date: Wed, 27 Mar 2019 17:02:30 +0800 [thread overview]
Message-ID: <20190327090230.12671-1-ming.lei@redhat.com> (raw)
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 following NVMe target assumption.
Reported-by: Yi Zhang <yi.zhang at redhat.com>
Fixes: 3a85a5de29ea ("nvme-loop: add a NVMe loopback host driver")
Cc: Yi Zhang <yi.zhang at redhat.com>
Cc: Sagi Grimberg <sagi at grimberg.me>
Cc: Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
Cc: <stable at vger.kernel.org>
Signed-off-by: Ming Lei <ming.lei at redhat.com>
---
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
next reply other threads:[~2019-03-27 9:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-27 9:02 Ming Lei [this message]
2019-03-27 16:16 ` [PATCH stable only] nvmet: set loop queue's segment boundary mask as PAGE_SIZE - 1 Sasha Levin
2019-03-28 0:55 ` Ming Lei
2019-04-01 13:55 ` Greg KH
2019-04-02 1:05 ` Ming Lei
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=20190327090230.12671-1-ming.lei@redhat.com \
--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