Skip to contentSkip to conversation

small fixes for 4.16 and -stable

PATCH New Christoph Hellwig 5 participants 13 messages Feb 22, 2018

Subsystems (2)
lore
Share & tools
lore

Christoph Hellwig

author maintainer
#0 lore raw

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

author maintainer
#1 lore raw

PATCH 1/3 nvme-fabrics: don't check for non-NULL module in nvmf_register_transport

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(-)
drivers/nvme/host/fabrics.c +1 -1
index 5dd4ceefed8f..a1c58e35075e 100644
@@ -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);
Signature · 1 line
2.14.2
#2 lore raw

PATCH 1/3 nvme-fabrics: don't check for non-NULL module in nvmf_register_transport

Quoted 5 lines · Christoph Hellwig

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>
author maintainer
#4 lore raw

PATCH 2/3 nvme-rdma: use blk_rq_payload_bytes instead of blk_rq_bytes

In reply to Christoph Hellwig

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(-)
drivers/nvme/host/rdma.c +2 -2
index 3a51ed50eff2..4d84a73ee12d 100644
@@ -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;
Signature · 1 line
2.14.2
#5 lore raw

PATCH 2/3 nvme-rdma: use blk_rq_payload_bytes instead of blk_rq_bytes

Quoted 4 lines · Christoph Hellwig

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>
#7 lore raw

PATCH 2/3 nvme-rdma: use blk_rq_payload_bytes instead of blk_rq_bytes

In reply to Christoph Hellwig

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>

Signature · 6 lines
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
#8 lore raw

PATCH 2/3 nvme-rdma: use blk_rq_payload_bytes instead of blk_rq_bytes

In reply to Christoph Hellwig
Quoted 2 lines · Christoph Hellwig

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.

author maintainer
#9 lore raw

PATCH 3/3 nvmet-loop: use blk_rq_payload_bytes for sgl selection

In reply to Christoph Hellwig

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(-)
drivers/nvme/target/loop.c +2 -2
index 7991ec3a17db..861d1509b22b 100644
@@ -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);
Signature · 1 line
2.14.2
#10 lore raw

PATCH 3/3 nvmet-loop: use blk_rq_payload_bytes for sgl selection

Quoted 4 lines · Christoph Hellwig

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>
#12 lore raw

PATCH 3/3 nvmet-loop: use blk_rq_payload_bytes for sgl selection

In reply to Christoph Hellwig

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>

Signature · 6 lines
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