All of lore.kernel.org
 help / color / mirror / Atom feed
* small fixes for 4.16 and -stable
@ 2018-02-22 15:24 Christoph Hellwig
  2018-02-22 15:24 ` [PATCH 1/3] nvme-fabrics: don't check for non-NULL module in nvmf_register_transport Christoph Hellwig
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Christoph Hellwig @ 2018-02-22 15:24 UTC (permalink / raw)


Fix a regression when using built-in transport drivers, and fix special
payload commands on rdma and loop.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/3] nvme-fabrics: don't check for non-NULL module in nvmf_register_transport
  2018-02-22 15:24 small fixes for 4.16 and -stable Christoph Hellwig
@ 2018-02-22 15:24 ` Christoph Hellwig
  2018-02-22 15:31   ` Keith Busch
  2018-02-22 15:34   ` Sagi Grimberg
  2018-02-22 15:24 ` [PATCH 2/3] nvme-rdma: use blk_rq_payload_bytes instead of blk_rq_bytes Christoph Hellwig
  2018-02-22 15:24 ` [PATCH 3/3] nvmet-loop: use blk_rq_payload_bytes for sgl selection Christoph Hellwig
  2 siblings, 2 replies; 13+ messages in thread
From: Christoph Hellwig @ 2018-02-22 15:24 UTC (permalink / raw)


THIS_MODULE evaluates to NULL when used from code built into the kernel,
thus breaking built-in transport modules.  Remove the bogus check.

Fixes: 0de5cd36 ("nvme-fabrics: protect against module unload during create_ctrl")
Signed-off-by: Christoph Hellwig <hch at lst.de>
---
 drivers/nvme/host/fabrics.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index 5dd4ceefed8f..a1c58e35075e 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -493,7 +493,7 @@ EXPORT_SYMBOL_GPL(nvmf_should_reconnect);
  */
 int nvmf_register_transport(struct nvmf_transport_ops *ops)
 {
-	if (!ops->create_ctrl || !ops->module)
+	if (!ops->create_ctrl)
 		return -EINVAL;
 
 	down_write(&nvmf_transports_rwsem);
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/3] nvme-rdma: use blk_rq_payload_bytes instead of blk_rq_bytes
  2018-02-22 15:24 small fixes for 4.16 and -stable Christoph Hellwig
  2018-02-22 15:24 ` [PATCH 1/3] nvme-fabrics: don't check for non-NULL module in nvmf_register_transport Christoph Hellwig
@ 2018-02-22 15:24 ` Christoph Hellwig
  2018-02-22 15:31   ` Keith Busch
                     ` (3 more replies)
  2018-02-22 15:24 ` [PATCH 3/3] nvmet-loop: use blk_rq_payload_bytes for sgl selection Christoph Hellwig
  2 siblings, 4 replies; 13+ messages in thread
From: Christoph Hellwig @ 2018-02-22 15:24 UTC (permalink / raw)


blk_rq_bytes does the wrong thing for special payloads like discards and
might cause the driver to not set up a SGL.

Signed-off-by: Christoph Hellwig <hch at lst.de>
---
 drivers/nvme/host/rdma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 3a51ed50eff2..4d84a73ee12d 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -1051,7 +1051,7 @@ static void nvme_rdma_unmap_data(struct nvme_rdma_queue *queue,
 	struct nvme_rdma_device *dev = queue->device;
 	struct ib_device *ibdev = dev->dev;
 
-	if (!blk_rq_bytes(rq))
+	if (!blk_rq_payload_bytes(rq))
 		return;
 
 	if (req->mr) {
@@ -1166,7 +1166,7 @@ static int nvme_rdma_map_data(struct nvme_rdma_queue *queue,
 
 	c->common.flags |= NVME_CMD_SGL_METABUF;
 
-	if (!blk_rq_bytes(rq))
+	if (!blk_rq_payload_bytes(rq))
 		return nvme_rdma_set_sg_null(c);
 
 	req->sg_table.sgl = req->first_sgl;
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/3] nvmet-loop: use blk_rq_payload_bytes for sgl selection
  2018-02-22 15:24 small fixes for 4.16 and -stable Christoph Hellwig
  2018-02-22 15:24 ` [PATCH 1/3] nvme-fabrics: don't check for non-NULL module in nvmf_register_transport Christoph Hellwig
  2018-02-22 15:24 ` [PATCH 2/3] nvme-rdma: use blk_rq_payload_bytes instead of blk_rq_bytes Christoph Hellwig
@ 2018-02-22 15:24 ` Christoph Hellwig
  2018-02-22 15:32   ` Keith Busch
                     ` (2 more replies)
  2 siblings, 3 replies; 13+ messages in thread
From: Christoph Hellwig @ 2018-02-22 15:24 UTC (permalink / raw)


blk_rq_bytes does the wrong thing for special payloads like discards and
might cause the driver to not set up a SGL.

Signed-off-by: Christoph Hellwig <hch at lst.de>
---
 drivers/nvme/target/loop.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c
index 7991ec3a17db..861d1509b22b 100644
--- a/drivers/nvme/target/loop.c
+++ b/drivers/nvme/target/loop.c
@@ -184,7 +184,7 @@ static blk_status_t nvme_loop_queue_rq(struct blk_mq_hw_ctx *hctx,
 		return BLK_STS_OK;
 	}
 
-	if (blk_rq_bytes(req)) {
+	if (blk_rq_payload_bytes(req)) {
 		iod->sg_table.sgl = iod->first_sgl;
 		if (sg_alloc_table_chained(&iod->sg_table,
 				blk_rq_nr_phys_segments(req),
@@ -193,7 +193,7 @@ static blk_status_t nvme_loop_queue_rq(struct blk_mq_hw_ctx *hctx,
 
 		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_bytes(req);
+		iod->req.transfer_len = blk_rq_payload_bytes(req);
 	}
 
 	blk_mq_start_request(req);
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 1/3] nvme-fabrics: don't check for non-NULL module in nvmf_register_transport
  2018-02-22 15:24 ` [PATCH 1/3] nvme-fabrics: don't check for non-NULL module in nvmf_register_transport Christoph Hellwig
@ 2018-02-22 15:31   ` Keith Busch
  2018-02-22 15:34   ` Sagi Grimberg
  1 sibling, 0 replies; 13+ messages in thread
From: Keith Busch @ 2018-02-22 15:31 UTC (permalink / raw)


On Thu, Feb 22, 2018@07:24:08AM -0800, Christoph Hellwig wrote:
> THIS_MODULE evaluates to NULL when used from code built into the kernel,
> thus breaking built-in transport modules.  Remove the bogus check.
> 
> Fixes: 0de5cd36 ("nvme-fabrics: protect against module unload during create_ctrl")
> Signed-off-by: Christoph Hellwig <hch at lst.de>

Looks good.

Reviewed-by: Keith Busch <keith.busch at intel.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 2/3] nvme-rdma: use blk_rq_payload_bytes instead of blk_rq_bytes
  2018-02-22 15:24 ` [PATCH 2/3] nvme-rdma: use blk_rq_payload_bytes instead of blk_rq_bytes Christoph Hellwig
@ 2018-02-22 15:31   ` Keith Busch
  2018-02-22 15:34   ` Sagi Grimberg
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Keith Busch @ 2018-02-22 15:31 UTC (permalink / raw)


On Thu, Feb 22, 2018@07:24:09AM -0800, Christoph Hellwig wrote:
> blk_rq_bytes does the wrong thing for special payloads like discards and
> might cause the driver to not set up a SGL.
> 
> Signed-off-by: Christoph Hellwig <hch at lst.de>

Looks good.

Reviewed-by: Keith Busch <keith.busch at intel.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 3/3] nvmet-loop: use blk_rq_payload_bytes for sgl selection
  2018-02-22 15:24 ` [PATCH 3/3] nvmet-loop: use blk_rq_payload_bytes for sgl selection Christoph Hellwig
@ 2018-02-22 15:32   ` Keith Busch
  2018-02-22 15:34   ` Sagi Grimberg
  2018-02-22 15:39   ` Johannes Thumshirn
  2 siblings, 0 replies; 13+ messages in thread
From: Keith Busch @ 2018-02-22 15:32 UTC (permalink / raw)


On Thu, Feb 22, 2018@07:24:10AM -0800, Christoph Hellwig wrote:
> blk_rq_bytes does the wrong thing for special payloads like discards and
> might cause the driver to not set up a SGL.
> 
> Signed-off-by: Christoph Hellwig <hch at lst.de>

Looks good.

Reviewed-by: Keith Busch <keith.busch at intel.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/3] nvme-fabrics: don't check for non-NULL module in nvmf_register_transport
  2018-02-22 15:24 ` [PATCH 1/3] nvme-fabrics: don't check for non-NULL module in nvmf_register_transport Christoph Hellwig
  2018-02-22 15:31   ` Keith Busch
@ 2018-02-22 15:34   ` Sagi Grimberg
  1 sibling, 0 replies; 13+ messages in thread
From: Sagi Grimberg @ 2018-02-22 15:34 UTC (permalink / raw)


Sorry :)

Reviewed-by: Sagi Grimberg <sagi at grimberg.me>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 2/3] nvme-rdma: use blk_rq_payload_bytes instead of blk_rq_bytes
  2018-02-22 15:24 ` [PATCH 2/3] nvme-rdma: use blk_rq_payload_bytes instead of blk_rq_bytes Christoph Hellwig
  2018-02-22 15:31   ` Keith Busch
@ 2018-02-22 15:34   ` Sagi Grimberg
  2018-02-22 15:39   ` Johannes Thumshirn
  2018-02-22 15:58   ` Bart Van Assche
  3 siblings, 0 replies; 13+ messages in thread
From: Sagi Grimberg @ 2018-02-22 15:34 UTC (permalink / raw)


Reviewed-by: Sagi Grimberg <sagi at grimberg.me>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 3/3] nvmet-loop: use blk_rq_payload_bytes for sgl selection
  2018-02-22 15:24 ` [PATCH 3/3] nvmet-loop: use blk_rq_payload_bytes for sgl selection Christoph Hellwig
  2018-02-22 15:32   ` Keith Busch
@ 2018-02-22 15:34   ` Sagi Grimberg
  2018-02-22 15:39   ` Johannes Thumshirn
  2 siblings, 0 replies; 13+ messages in thread
From: Sagi Grimberg @ 2018-02-22 15:34 UTC (permalink / raw)


Reviewed-by: Sagi Grimberg <sagi at grimberg.me>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 2/3] nvme-rdma: use blk_rq_payload_bytes instead of blk_rq_bytes
  2018-02-22 15:24 ` [PATCH 2/3] nvme-rdma: use blk_rq_payload_bytes instead of blk_rq_bytes Christoph Hellwig
  2018-02-22 15:31   ` Keith Busch
  2018-02-22 15:34   ` Sagi Grimberg
@ 2018-02-22 15:39   ` Johannes Thumshirn
  2018-02-22 15:58   ` Bart Van Assche
  3 siblings, 0 replies; 13+ messages in thread
From: Johannes Thumshirn @ 2018-02-22 15:39 UTC (permalink / raw)


Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>
-- 
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 3/3] nvmet-loop: use blk_rq_payload_bytes for sgl selection
  2018-02-22 15:24 ` [PATCH 3/3] nvmet-loop: use blk_rq_payload_bytes for sgl selection Christoph Hellwig
  2018-02-22 15:32   ` Keith Busch
  2018-02-22 15:34   ` Sagi Grimberg
@ 2018-02-22 15:39   ` Johannes Thumshirn
  2 siblings, 0 replies; 13+ messages in thread
From: Johannes Thumshirn @ 2018-02-22 15:39 UTC (permalink / raw)


Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>
-- 
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 2/3] nvme-rdma: use blk_rq_payload_bytes instead of blk_rq_bytes
  2018-02-22 15:24 ` [PATCH 2/3] nvme-rdma: use blk_rq_payload_bytes instead of blk_rq_bytes Christoph Hellwig
                     ` (2 preceding siblings ...)
  2018-02-22 15:39   ` Johannes Thumshirn
@ 2018-02-22 15:58   ` Bart Van Assche
  3 siblings, 0 replies; 13+ messages in thread
From: Bart Van Assche @ 2018-02-22 15:58 UTC (permalink / raw)


On 02/22/18 07:24, Christoph Hellwig wrote:
> blk_rq_bytes does the wrong thing for special payloads like discards and
> might cause the driver to not set up a SGL.

Should "Fixes:" and "Cc: stable" tags be added to this patch?

Thanks,

Bart.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-02-22 15:58 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-22 15:24 small fixes for 4.16 and -stable Christoph Hellwig
2018-02-22 15:24 ` [PATCH 1/3] nvme-fabrics: don't check for non-NULL module in nvmf_register_transport Christoph Hellwig
2018-02-22 15:31   ` Keith Busch
2018-02-22 15:34   ` Sagi Grimberg
2018-02-22 15:24 ` [PATCH 2/3] nvme-rdma: use blk_rq_payload_bytes instead of blk_rq_bytes Christoph Hellwig
2018-02-22 15:31   ` Keith Busch
2018-02-22 15:34   ` Sagi Grimberg
2018-02-22 15:39   ` Johannes Thumshirn
2018-02-22 15:58   ` Bart Van Assche
2018-02-22 15:24 ` [PATCH 3/3] nvmet-loop: use blk_rq_payload_bytes for sgl selection Christoph Hellwig
2018-02-22 15:32   ` Keith Busch
2018-02-22 15:34   ` Sagi Grimberg
2018-02-22 15:39   ` Johannes Thumshirn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.