Skip to contentSkip to conversation

nvmet: set loop queue's segment boundary mask as PAGE_SIZE - 1

PATCH New Ming Lei 3 participants 5 messages Mar 27, 2019 – Apr 2, 2019

Subsystems (2)
lore
Share & tools
lore

Ming Lei

author
#0 lore raw

PATCH 1/1 nvmet: set loop queue's segment boundary mask as PAGE_SIZE - 1

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(+)
drivers/nvme/target/loop.c +3 -0
index b9f623ab01f3..7194f86b9dac 100644
@@ -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:
Signature · 1 line
2.9.5
maintainer
#1 lore raw

PATCH 1/1 nvmet: set loop queue's segment boundary mask as PAGE_SIZE - 1

Quoted 9 lines · Ming Lei

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.

Quoted 7 lines
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>

Could you provide some background as to why this is -stable only in the commit message?

--
Thanks,
Sasha

author
#2 lore raw

PATCH 1/1 nvmet: set loop queue's segment boundary mask as PAGE_SIZE - 1

Quoted 18 lines · Sasha Levin
Quoted 9 lines · Ming Lei

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.

Quoted 7 lines
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>
Quoted 2 lines

Could you provide some background as to why this is -stable only in the commit message?

Multi-page bvec has been merged to linus tree already, so the following patch simply can fix the current issue without needing to limit the segment size for nvme-loop:

http://lists.infradead.org/pipermail/linux-nvme/2019-March/023105.html

Thanks,
Ming

maintainer
#3 lore raw

PATCH 1/1 nvmet: set loop queue's segment boundary mask as PAGE_SIZE - 1

Quoted 19 lines · Ming Lei
Quoted 18 lines · Sasha Levin
Quoted 16 lines · Ming Lei

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>
Quoted 8 lines
Quoted 2 lines

Could you provide some background as to why this is -stable only in the commit message?

Multi-page bvec has been merged to linus tree already, so the following patch simply can fix the current issue without needing to limit the segment size for nvme-loop:

http://lists.infradead.org/pipermail/linux-nvme/2019-March/023105.html

Can you resend the patch with this needed information in it? Also, I don't understand what you are referring to with that url, why can't we just use that patch?

thanks,

greg k-h

author
#4 lore raw

PATCH 1/1 nvmet: set loop queue's segment boundary mask as PAGE_SIZE - 1

Quoted 27 lines · Greg KH
Quoted 26 lines · Ming Lei
Quoted 18 lines · Sasha Levin
Quoted 9 lines · Ming Lei

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.

Quoted 7 lines
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>
Quoted 2 lines

Could you provide some background as to why this is -stable only in the commit message?

Multi-page bvec has been merged to linus tree already, so the following patch simply can fix the current issue without needing to limit the segment size for nvme-loop:

Quoted 5 lines
Quoted 1 line

http://lists.infradead.org/pipermail/linux-nvme/2019-March/023105.html

Can you resend the patch with this needed information in it? Also, I don't understand what you are referring to with that url, why can't we just use that patch?

Sure, will resend the patch with the above info soon.

Thanks,
Ming