Linux-Next Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/2] scsi: core: regression fixes for request batching
@ 2019-08-07 14:49 Steffen Maier
  2019-08-07 14:49 ` [PATCH 1/2] scsi: core: fix missing .cleanup_rq for SCSI hosts without " Steffen Maier
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Steffen Maier @ 2019-08-07 14:49 UTC (permalink / raw)
  To: James E . J . Bottomley, Martin K . Petersen, Paolo Bonzini, Ming Lei
  Cc: linux-next, linux-scsi, linux-block, dm-devel, linux-s390,
	Benjamin Block, Heiko Carstens, Vasily Gorbik, Steffen Maier,
	Bart Van Assche, Hannes Reinecke, Jens Axboe, Ewan D . Milne,
	Christoph Hellwig, Mike Snitzer

Hi James, Martin, Paolo, Ming,

multipathing with linux-next is broken since 20190723 in our CI.
The patches fix a memleak and a severe dh/multipath functional regression.
It would be nice if we could get them to 5.4/scsi-queue and also next.

I would have preferred if such a new feature had used its own
new copy scsi_mq_ops_batching instead of changing the use case and
semantics of the existing scsi_mq_ops, because this would likely
cause less regressions for all the other users not using the new feature.

Steffen Maier (2):
  scsi: core: fix missing .cleanup_rq for SCSI hosts without request
    batching
  scsi: core: fix dh and multipathing for SCSI hosts without request
    batching

 drivers/scsi/scsi_lib.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

-- 
2.17.1


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

* [PATCH 1/2] scsi: core: fix missing .cleanup_rq for SCSI hosts without request batching
  2019-08-07 14:49 [PATCH 0/2] scsi: core: regression fixes for request batching Steffen Maier
@ 2019-08-07 14:49 ` " Steffen Maier
  2019-08-07 23:32   ` Ming Lei
                     ` (2 more replies)
  2019-08-07 14:49 ` [PATCH 2/2] scsi: core: fix dh and multipathing " Steffen Maier
                   ` (2 subsequent siblings)
  3 siblings, 3 replies; 14+ messages in thread
From: Steffen Maier @ 2019-08-07 14:49 UTC (permalink / raw)
  To: James E . J . Bottomley, Martin K . Petersen, Paolo Bonzini, Ming Lei
  Cc: linux-next, linux-scsi, linux-block, dm-devel, linux-s390,
	Benjamin Block, Heiko Carstens, Vasily Gorbik, Steffen Maier,
	Bart Van Assche, Hannes Reinecke, Jens Axboe, Ewan D . Milne,
	Christoph Hellwig, Mike Snitzer

This was missing from scsi_mq_ops_no_commit of linux-next commit
8930a6c20791 ("scsi: core: add support for request batching")
from Martin's scsi/5.4/scsi-queue or James' scsi/misc.

See also linux-next commit b7e9e1fb7a92 ("scsi: implement .cleanup_rq
callback") from block/for-next.

Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Fixes: 8930a6c20791 ("scsi: core: add support for request batching")
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Ming Lei <ming.lei@redhat.com>
---
 drivers/scsi/scsi_lib.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index ae03d3e2600f..90c257622bb0 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1834,6 +1834,7 @@ static const struct blk_mq_ops scsi_mq_ops_no_commit = {
 	.init_request	= scsi_mq_init_request,
 	.exit_request	= scsi_mq_exit_request,
 	.initialize_rq_fn = scsi_initialize_rq,
+	.cleanup_rq	= scsi_cleanup_rq,
 	.busy		= scsi_mq_lld_busy,
 	.map_queues	= scsi_map_queues,
 };
-- 
2.17.1


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

* [PATCH 2/2] scsi: core: fix dh and multipathing for SCSI hosts without request batching
  2019-08-07 14:49 [PATCH 0/2] scsi: core: regression fixes for request batching Steffen Maier
  2019-08-07 14:49 ` [PATCH 1/2] scsi: core: fix missing .cleanup_rq for SCSI hosts without " Steffen Maier
@ 2019-08-07 14:49 ` " Steffen Maier
  2019-08-08  6:02   ` kbuild test robot
  2019-08-09  9:08   ` kbuild test robot
  2019-08-07 16:17 ` [PATCH 0/2] scsi: core: regression fixes for " Paolo Bonzini
  2019-08-07 17:08 ` Bart Van Assche
  3 siblings, 2 replies; 14+ messages in thread
From: Steffen Maier @ 2019-08-07 14:49 UTC (permalink / raw)
  To: James E . J . Bottomley, Martin K . Petersen, Paolo Bonzini, Ming Lei
  Cc: linux-next, linux-scsi, linux-block, dm-devel, linux-s390,
	Benjamin Block, Heiko Carstens, Vasily Gorbik, Steffen Maier,
	Bart Van Assche, Hannes Reinecke, Jens Axboe, Ewan D . Milne,
	Christoph Hellwig, Mike Snitzer

This was missing from scsi_device_from_queue() due to the introduction
of another new scsi_mq_ops_no_commit of linux-next commit
8930a6c20791 ("scsi: core: add support for request batching")
from Martin's scsi/5.4/scsi-queue or James' scsi/misc.

Only devicehandler code seems to call scsi_device_from_queue():
*** drivers/scsi/scsi_dh.c:
scsi_dh_activate[255]          sdev = scsi_device_from_queue(q);
scsi_dh_set_params[302]        sdev = scsi_device_from_queue(q);
scsi_dh_attach[325]            sdev = scsi_device_from_queue(q);
scsi_dh_attached_handler_name[363] sdev = scsi_device_from_queue(q);

Fixes multipath tools follow-on errors:

$ multipath -v6
...
libdevmapper: ioctl/libdm-iface.c(1887): device-mapper: reload ioctl on mpatha  failed: No such device
...
mpatha: failed to load map, error 19
...

showing also as kernel messages:

device-mapper: table: 252:0: multipath: error attaching hardware handler
device-mapper: ioctl: error adding target to table

Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Fixes: 8930a6c20791 ("scsi: core: add support for request batching")
Cc: Paolo Bonzini <pbonzini@redhat.com>
---
 drivers/scsi/scsi_lib.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 90c257622bb0..73e7d29fbd66 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1922,7 +1922,8 @@ struct scsi_device *scsi_device_from_queue(struct request_queue *q)
 {
 	struct scsi_device *sdev = NULL;
 
-	if (q->mq_ops == &scsi_mq_ops)
+	if (q->mq_ops == &scsi_mq_ops_no_commit ||
+	    q->mq_ops == &scsi_mq_ops)
 		sdev = q->queuedata;
 	if (!sdev || !get_device(&sdev->sdev_gendev))
 		sdev = NULL;
-- 
2.17.1


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

* Re: [PATCH 0/2] scsi: core: regression fixes for request batching
  2019-08-07 14:49 [PATCH 0/2] scsi: core: regression fixes for request batching Steffen Maier
  2019-08-07 14:49 ` [PATCH 1/2] scsi: core: fix missing .cleanup_rq for SCSI hosts without " Steffen Maier
  2019-08-07 14:49 ` [PATCH 2/2] scsi: core: fix dh and multipathing " Steffen Maier
@ 2019-08-07 16:17 ` " Paolo Bonzini
  2019-08-07 17:08 ` Bart Van Assche
  3 siblings, 0 replies; 14+ messages in thread
From: Paolo Bonzini @ 2019-08-07 16:17 UTC (permalink / raw)
  To: Steffen Maier, James E . J . Bottomley, Martin K . Petersen, Ming Lei
  Cc: linux-next, linux-scsi, linux-block, dm-devel, linux-s390,
	Benjamin Block, Heiko Carstens, Vasily Gorbik, Bart Van Assche,
	Hannes Reinecke, Jens Axboe, Ewan D . Milne, Christoph Hellwig,
	Mike Snitzer

On 07/08/19 16:49, Steffen Maier wrote:
> Hi James, Martin, Paolo, Ming,
> 
> multipathing with linux-next is broken since 20190723 in our CI.
> The patches fix a memleak and a severe dh/multipath functional regression.
> It would be nice if we could get them to 5.4/scsi-queue and also next.
> 
> I would have preferred if such a new feature had used its own
> new copy scsi_mq_ops_batching instead of changing the use case and
> semantics of the existing scsi_mq_ops, because this would likely
> cause less regressions for all the other users not using the new feature.
> 
> Steffen Maier (2):
>   scsi: core: fix missing .cleanup_rq for SCSI hosts without request
>     batching
>   scsi: core: fix dh and multipathing for SCSI hosts without request
>     batching
> 
>  drivers/scsi/scsi_lib.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

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

* Re: [PATCH 0/2] scsi: core: regression fixes for request batching
  2019-08-07 14:49 [PATCH 0/2] scsi: core: regression fixes for request batching Steffen Maier
                   ` (2 preceding siblings ...)
  2019-08-07 16:17 ` [PATCH 0/2] scsi: core: regression fixes for " Paolo Bonzini
@ 2019-08-07 17:08 ` Bart Van Assche
  3 siblings, 0 replies; 14+ messages in thread
From: Bart Van Assche @ 2019-08-07 17:08 UTC (permalink / raw)
  To: Steffen Maier, James E . J . Bottomley, Martin K . Petersen,
	Paolo Bonzini, Ming Lei
  Cc: linux-next, linux-scsi, linux-block, dm-devel, linux-s390,
	Benjamin Block, Heiko Carstens, Vasily Gorbik, Hannes Reinecke,
	Jens Axboe, Ewan D . Milne, Christoph Hellwig, Mike Snitzer

On 8/7/19 7:49 AM, Steffen Maier wrote:
> Hi James, Martin, Paolo, Ming,
> 
> multipathing with linux-next is broken since 20190723 in our CI.
> The patches fix a memleak and a severe dh/multipath functional regression.
> It would be nice if we could get them to 5.4/scsi-queue and also next.
 >
> I would have preferred if such a new feature had used its own
> new copy scsi_mq_ops_batching instead of changing the use case and
> semantics of the existing scsi_mq_ops, because this would likely
> cause less regressions for all the other users not using the new feature.

For both patches:

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

BTW, these two patches fix several nvmeof-mp blktests regressions.

Bart.

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

* Re: [PATCH 1/2] scsi: core: fix missing .cleanup_rq for SCSI hosts without request batching
  2019-08-07 14:49 ` [PATCH 1/2] scsi: core: fix missing .cleanup_rq for SCSI hosts without " Steffen Maier
@ 2019-08-07 23:32   ` Ming Lei
  2019-08-08  2:18     ` Martin K. Petersen
  2019-08-08  5:52   ` kbuild test robot
  2019-08-09  1:56   ` kbuild test robot
  2 siblings, 1 reply; 14+ messages in thread
From: Ming Lei @ 2019-08-07 23:32 UTC (permalink / raw)
  To: Steffen Maier
  Cc: James E . J . Bottomley, Martin K . Petersen, Paolo Bonzini,
	Ming Lei, Linux-Next Mailing List, Linux SCSI List, linux-block,
	open list:DEVICE-MAPPER (LVM),
	linux-s390, Benjamin Block, Heiko Carstens, Vasily Gorbik,
	Bart Van Assche, Hannes Reinecke, Jens Axboe, Ewan D . Milne,
	Christoph Hellwig, Mike Snitzer

On Wed, Aug 7, 2019 at 10:55 PM Steffen Maier <maier@linux.ibm.com> wrote:
>
> This was missing from scsi_mq_ops_no_commit of linux-next commit
> 8930a6c20791 ("scsi: core: add support for request batching")
> from Martin's scsi/5.4/scsi-queue or James' scsi/misc.
>
> See also linux-next commit b7e9e1fb7a92 ("scsi: implement .cleanup_rq
> callback") from block/for-next.
>
> Signed-off-by: Steffen Maier <maier@linux.ibm.com>
> Fixes: 8930a6c20791 ("scsi: core: add support for request batching")
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Ming Lei <ming.lei@redhat.com>
> ---
>  drivers/scsi/scsi_lib.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> index ae03d3e2600f..90c257622bb0 100644
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
> @@ -1834,6 +1834,7 @@ static const struct blk_mq_ops scsi_mq_ops_no_commit = {
>         .init_request   = scsi_mq_init_request,
>         .exit_request   = scsi_mq_exit_request,
>         .initialize_rq_fn = scsi_initialize_rq,
> +       .cleanup_rq     = scsi_cleanup_rq,
>         .busy           = scsi_mq_lld_busy,
>         .map_queues     = scsi_map_queues,
>  };

This one is a cross-tree thing, either scsi/5.4/scsi-queue needs to
pull for-5.4/block, or
do it after both land linus tree.

Thanks,
Ming Lei

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

* Re: [PATCH 1/2] scsi: core: fix missing .cleanup_rq for SCSI hosts without request batching
  2019-08-07 23:32   ` Ming Lei
@ 2019-08-08  2:18     ` Martin K. Petersen
  2019-09-18 15:09       ` Steffen Maier
  0 siblings, 1 reply; 14+ messages in thread
From: Martin K. Petersen @ 2019-08-08  2:18 UTC (permalink / raw)
  To: Ming Lei
  Cc: Steffen Maier, James E . J . Bottomley, Martin K . Petersen,
	Paolo Bonzini, Ming Lei, Linux-Next Mailing List,
	Linux SCSI List, linux-block, open list\:DEVICE-MAPPER \(LVM\),
	linux-s390, Benjamin Block, Heiko Carstens, Vasily Gorbik,
	Bart Van Assche, Hannes Reinecke, Jens Axboe, Ewan D . Milne,
	Christoph Hellwig, Mike Snitzer


Ming,

>> +       .cleanup_rq     = scsi_cleanup_rq,
>>         .busy           = scsi_mq_lld_busy,
>>         .map_queues     = scsi_map_queues,
>>  };
>
> This one is a cross-tree thing, either scsi/5.4/scsi-queue needs to
> pull for-5.4/block, or do it after both land linus tree.

I'll set up an amalgamated for-next branch tomorrow.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH 1/2] scsi: core: fix missing .cleanup_rq for SCSI hosts without request batching
  2019-08-07 14:49 ` [PATCH 1/2] scsi: core: fix missing .cleanup_rq for SCSI hosts without " Steffen Maier
  2019-08-07 23:32   ` Ming Lei
@ 2019-08-08  5:52   ` kbuild test robot
  2019-08-09  1:56   ` kbuild test robot
  2 siblings, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2019-08-08  5:52 UTC (permalink / raw)
  To: Steffen Maier
  Cc: kbuild-all, James E . J . Bottomley, Martin K . Petersen,
	Paolo Bonzini, Ming Lei, linux-next, linux-scsi, linux-block,
	dm-devel, linux-s390, Benjamin Block, Heiko Carstens,
	Vasily Gorbik, Steffen Maier, Bart Van Assche, Hannes Reinecke,
	Jens Axboe, Ewan D . Milne, Christoph Hellwig, Mike Snitzer

[-- Attachment #1: Type: text/plain, Size: 2098 bytes --]

Hi Steffen,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[cannot apply to v5.3-rc3 next-20190807]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Steffen-Maier/scsi-core-fix-missing-cleanup_rq-for-SCSI-hosts-without-request-batching/20190808-052017
config: riscv-defconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=riscv 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/scsi/scsi_lib.c:1824:3: error: 'const struct blk_mq_ops' has no member named 'cleanup_rq'; did you mean 'queue_rq'?
     .cleanup_rq = scsi_cleanup_rq,
      ^~~~~~~~~~
      queue_rq
>> drivers/scsi/scsi_lib.c:1824:16: error: 'scsi_cleanup_rq' undeclared here (not in a function); did you mean 'scsi_queue_rq'?
     .cleanup_rq = scsi_cleanup_rq,
                   ^~~~~~~~~~~~~~~
                   scsi_queue_rq

vim +1824 drivers/scsi/scsi_lib.c

  1811	
  1812	static const struct blk_mq_ops scsi_mq_ops = {
  1813		.get_budget	= scsi_mq_get_budget,
  1814		.put_budget	= scsi_mq_put_budget,
  1815		.queue_rq	= scsi_queue_rq,
  1816		.complete	= scsi_softirq_done,
  1817		.timeout	= scsi_timeout,
  1818	#ifdef CONFIG_BLK_DEBUG_FS
  1819		.show_rq	= scsi_show_rq,
  1820	#endif
  1821		.init_request	= scsi_mq_init_request,
  1822		.exit_request	= scsi_mq_exit_request,
  1823		.initialize_rq_fn = scsi_initialize_rq,
> 1824		.cleanup_rq	= scsi_cleanup_rq,
  1825		.busy		= scsi_mq_lld_busy,
  1826		.map_queues	= scsi_map_queues,
  1827	};
  1828	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 18358 bytes --]

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

* Re: [PATCH 2/2] scsi: core: fix dh and multipathing for SCSI hosts without request batching
  2019-08-07 14:49 ` [PATCH 2/2] scsi: core: fix dh and multipathing " Steffen Maier
@ 2019-08-08  6:02   ` kbuild test robot
  2019-08-09  9:08   ` kbuild test robot
  1 sibling, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2019-08-08  6:02 UTC (permalink / raw)
  To: Steffen Maier
  Cc: kbuild-all, James E . J . Bottomley, Martin K . Petersen,
	Paolo Bonzini, Ming Lei, linux-next, linux-scsi, linux-block,
	dm-devel, linux-s390, Benjamin Block, Heiko Carstens,
	Vasily Gorbik, Steffen Maier, Bart Van Assche, Hannes Reinecke,
	Jens Axboe, Ewan D . Milne, Christoph Hellwig, Mike Snitzer

[-- Attachment #1: Type: text/plain, Size: 4874 bytes --]

Hi Steffen,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[cannot apply to v5.3-rc3 next-20190807]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Steffen-Maier/scsi-core-fix-missing-cleanup_rq-for-SCSI-hosts-without-request-batching/20190808-052017
config: riscv-defconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=riscv 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/scsi/scsi_lib.c:1824:3: error: 'const struct blk_mq_ops' has no member named 'cleanup_rq'; did you mean 'queue_rq'?
     .cleanup_rq = scsi_cleanup_rq,
      ^~~~~~~~~~
      queue_rq
   drivers/scsi/scsi_lib.c:1824:16: error: 'scsi_cleanup_rq' undeclared here (not in a function); did you mean 'scsi_queue_rq'?
     .cleanup_rq = scsi_cleanup_rq,
                   ^~~~~~~~~~~~~~~
                   scsi_queue_rq
   drivers/scsi/scsi_lib.c: In function 'scsi_device_from_queue':
>> drivers/scsi/scsi_lib.c:1881:20: error: 'scsi_mq_ops_no_commit' undeclared (first use in this function); did you mean 'scsi_mq_ops'?
     if (q->mq_ops == &scsi_mq_ops_no_commit ||
                       ^~~~~~~~~~~~~~~~~~~~~
                       scsi_mq_ops
   drivers/scsi/scsi_lib.c:1881:20: note: each undeclared identifier is reported only once for each function it appears in

vim +1881 drivers/scsi/scsi_lib.c

  1811	
  1812	static const struct blk_mq_ops scsi_mq_ops = {
  1813		.get_budget	= scsi_mq_get_budget,
  1814		.put_budget	= scsi_mq_put_budget,
  1815		.queue_rq	= scsi_queue_rq,
  1816		.complete	= scsi_softirq_done,
  1817		.timeout	= scsi_timeout,
  1818	#ifdef CONFIG_BLK_DEBUG_FS
  1819		.show_rq	= scsi_show_rq,
  1820	#endif
  1821		.init_request	= scsi_mq_init_request,
  1822		.exit_request	= scsi_mq_exit_request,
  1823		.initialize_rq_fn = scsi_initialize_rq,
> 1824		.cleanup_rq	= scsi_cleanup_rq,
  1825		.busy		= scsi_mq_lld_busy,
  1826		.map_queues	= scsi_map_queues,
  1827	};
  1828	
  1829	struct request_queue *scsi_mq_alloc_queue(struct scsi_device *sdev)
  1830	{
  1831		sdev->request_queue = blk_mq_init_queue(&sdev->host->tag_set);
  1832		if (IS_ERR(sdev->request_queue))
  1833			return NULL;
  1834	
  1835		sdev->request_queue->queuedata = sdev;
  1836		__scsi_init_queue(sdev->host, sdev->request_queue);
  1837		blk_queue_flag_set(QUEUE_FLAG_SCSI_PASSTHROUGH, sdev->request_queue);
  1838		return sdev->request_queue;
  1839	}
  1840	
  1841	int scsi_mq_setup_tags(struct Scsi_Host *shost)
  1842	{
  1843		unsigned int cmd_size, sgl_size;
  1844	
  1845		sgl_size = scsi_mq_inline_sgl_size(shost);
  1846		cmd_size = sizeof(struct scsi_cmnd) + shost->hostt->cmd_size + sgl_size;
  1847		if (scsi_host_get_prot(shost))
  1848			cmd_size += sizeof(struct scsi_data_buffer) +
  1849				sizeof(struct scatterlist) * SCSI_INLINE_PROT_SG_CNT;
  1850	
  1851		memset(&shost->tag_set, 0, sizeof(shost->tag_set));
  1852		shost->tag_set.ops = &scsi_mq_ops;
  1853		shost->tag_set.nr_hw_queues = shost->nr_hw_queues ? : 1;
  1854		shost->tag_set.queue_depth = shost->can_queue;
  1855		shost->tag_set.cmd_size = cmd_size;
  1856		shost->tag_set.numa_node = NUMA_NO_NODE;
  1857		shost->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
  1858		shost->tag_set.flags |=
  1859			BLK_ALLOC_POLICY_TO_MQ_FLAG(shost->hostt->tag_alloc_policy);
  1860		shost->tag_set.driver_data = shost;
  1861	
  1862		return blk_mq_alloc_tag_set(&shost->tag_set);
  1863	}
  1864	
  1865	void scsi_mq_destroy_tags(struct Scsi_Host *shost)
  1866	{
  1867		blk_mq_free_tag_set(&shost->tag_set);
  1868	}
  1869	
  1870	/**
  1871	 * scsi_device_from_queue - return sdev associated with a request_queue
  1872	 * @q: The request queue to return the sdev from
  1873	 *
  1874	 * Return the sdev associated with a request queue or NULL if the
  1875	 * request_queue does not reference a SCSI device.
  1876	 */
  1877	struct scsi_device *scsi_device_from_queue(struct request_queue *q)
  1878	{
  1879		struct scsi_device *sdev = NULL;
  1880	
> 1881		if (q->mq_ops == &scsi_mq_ops_no_commit ||
  1882		    q->mq_ops == &scsi_mq_ops)
  1883			sdev = q->queuedata;
  1884		if (!sdev || !get_device(&sdev->sdev_gendev))
  1885			sdev = NULL;
  1886	
  1887		return sdev;
  1888	}
  1889	EXPORT_SYMBOL_GPL(scsi_device_from_queue);
  1890	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 18358 bytes --]

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

* Re: [PATCH 1/2] scsi: core: fix missing .cleanup_rq for SCSI hosts without request batching
  2019-08-07 14:49 ` [PATCH 1/2] scsi: core: fix missing .cleanup_rq for SCSI hosts without " Steffen Maier
  2019-08-07 23:32   ` Ming Lei
  2019-08-08  5:52   ` kbuild test robot
@ 2019-08-09  1:56   ` kbuild test robot
  2 siblings, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2019-08-09  1:56 UTC (permalink / raw)
  To: Steffen Maier
  Cc: kbuild-all, James E . J . Bottomley, Martin K . Petersen,
	Paolo Bonzini, Ming Lei, linux-next, linux-scsi, linux-block,
	dm-devel, linux-s390, Benjamin Block, Heiko Carstens,
	Vasily Gorbik, Steffen Maier, Bart Van Assche, Hannes Reinecke,
	Jens Axboe, Ewan D . Milne, Christoph Hellwig, Mike Snitzer

[-- Attachment #1: Type: text/plain, Size: 2387 bytes --]

Hi Steffen,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[cannot apply to v5.3-rc3 next-20190808]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Steffen-Maier/scsi-core-fix-missing-cleanup_rq-for-SCSI-hosts-without-request-batching/20190808-052017
config: s390-allmodconfig (attached as .config)
compiler: s390-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=s390 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers//scsi/scsi_lib.c:1824:3: error: 'const struct blk_mq_ops' has no member named 'cleanup_rq'; did you mean 'queue_rq'?
     .cleanup_rq = scsi_cleanup_rq,
      ^~~~~~~~~~
      queue_rq
   drivers//scsi/scsi_lib.c:1824:16: error: 'scsi_cleanup_rq' undeclared here (not in a function); did you mean 'scsi_queue_rq'?
     .cleanup_rq = scsi_cleanup_rq,
                   ^~~~~~~~~~~~~~~
                   scsi_queue_rq
>> drivers//scsi/scsi_lib.c:1824:16: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
   drivers//scsi/scsi_lib.c:1824:16: note: (near initialization for 'scsi_mq_ops')
   cc1: some warnings being treated as errors

vim +1824 drivers//scsi/scsi_lib.c

  1811	
  1812	static const struct blk_mq_ops scsi_mq_ops = {
  1813		.get_budget	= scsi_mq_get_budget,
  1814		.put_budget	= scsi_mq_put_budget,
  1815		.queue_rq	= scsi_queue_rq,
  1816		.complete	= scsi_softirq_done,
  1817		.timeout	= scsi_timeout,
  1818	#ifdef CONFIG_BLK_DEBUG_FS
  1819		.show_rq	= scsi_show_rq,
  1820	#endif
  1821		.init_request	= scsi_mq_init_request,
  1822		.exit_request	= scsi_mq_exit_request,
  1823		.initialize_rq_fn = scsi_initialize_rq,
> 1824		.cleanup_rq	= scsi_cleanup_rq,
  1825		.busy		= scsi_mq_lld_busy,
  1826		.map_queues	= scsi_map_queues,
  1827	};
  1828	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 55829 bytes --]

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

* Re: [PATCH 2/2] scsi: core: fix dh and multipathing for SCSI hosts without request batching
  2019-08-07 14:49 ` [PATCH 2/2] scsi: core: fix dh and multipathing " Steffen Maier
  2019-08-08  6:02   ` kbuild test robot
@ 2019-08-09  9:08   ` kbuild test robot
  1 sibling, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2019-08-09  9:08 UTC (permalink / raw)
  To: Steffen Maier
  Cc: kbuild-all, James E . J . Bottomley, Martin K . Petersen,
	Paolo Bonzini, Ming Lei, linux-next, linux-scsi, linux-block,
	dm-devel, linux-s390, Benjamin Block, Heiko Carstens,
	Vasily Gorbik, Steffen Maier, Bart Van Assche, Hannes Reinecke,
	Jens Axboe, Ewan D . Milne, Christoph Hellwig, Mike Snitzer

[-- Attachment #1: Type: text/plain, Size: 3583 bytes --]

Hi Steffen,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[cannot apply to v5.3-rc3 next-20190808]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Steffen-Maier/scsi-core-fix-missing-cleanup_rq-for-SCSI-hosts-without-request-batching/20190808-052017
config: i386-randconfig-d003-201931 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-10) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/scsi/scsi_lib.c:1824:3: error: 'const struct blk_mq_ops' has no member named 'cleanup_rq'; did you mean 'queue_rq'?
     .cleanup_rq = scsi_cleanup_rq,
      ^~~~~~~~~~
      queue_rq
   drivers/scsi/scsi_lib.c:1824:16: error: 'scsi_cleanup_rq' undeclared here (not in a function); did you mean 'scsi_queue_rq'?
     .cleanup_rq = scsi_cleanup_rq,
                   ^~~~~~~~~~~~~~~
                   scsi_queue_rq
   In file included from include/linux/export.h:45:0,
                    from include/linux/linkage.h:7,
                    from include/linux/fs.h:5,
                    from include/linux/highmem.h:5,
                    from include/linux/bio.h:8,
                    from drivers/scsi/scsi_lib.c:12:
   drivers/scsi/scsi_lib.c: In function 'scsi_device_from_queue':
   drivers/scsi/scsi_lib.c:1881:20: error: 'scsi_mq_ops_no_commit' undeclared (first use in this function); did you mean 'scsi_mq_ops'?
     if (q->mq_ops == &scsi_mq_ops_no_commit ||
                       ^
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                       ^~~~
>> drivers/scsi/scsi_lib.c:1881:2: note: in expansion of macro 'if'
     if (q->mq_ops == &scsi_mq_ops_no_commit ||
     ^~
   drivers/scsi/scsi_lib.c:1881:20: note: each undeclared identifier is reported only once for each function it appears in
     if (q->mq_ops == &scsi_mq_ops_no_commit ||
                       ^
   include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
    #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                       ^~~~
>> drivers/scsi/scsi_lib.c:1881:2: note: in expansion of macro 'if'
     if (q->mq_ops == &scsi_mq_ops_no_commit ||
     ^~

vim +/if +1881 drivers/scsi/scsi_lib.c

  1869	
  1870	/**
  1871	 * scsi_device_from_queue - return sdev associated with a request_queue
  1872	 * @q: The request queue to return the sdev from
  1873	 *
  1874	 * Return the sdev associated with a request queue or NULL if the
  1875	 * request_queue does not reference a SCSI device.
  1876	 */
  1877	struct scsi_device *scsi_device_from_queue(struct request_queue *q)
  1878	{
  1879		struct scsi_device *sdev = NULL;
  1880	
> 1881		if (q->mq_ops == &scsi_mq_ops_no_commit ||
  1882		    q->mq_ops == &scsi_mq_ops)
  1883			sdev = q->queuedata;
  1884		if (!sdev || !get_device(&sdev->sdev_gendev))
  1885			sdev = NULL;
  1886	
  1887		return sdev;
  1888	}
  1889	EXPORT_SYMBOL_GPL(scsi_device_from_queue);
  1890	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 27374 bytes --]

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

* Re: [PATCH 1/2] scsi: core: fix missing .cleanup_rq for SCSI hosts without request batching
  2019-08-08  2:18     ` Martin K. Petersen
@ 2019-09-18 15:09       ` Steffen Maier
  2019-09-18 15:22         ` Martin K. Petersen
  2019-09-18 15:32         ` Mark Brown
  0 siblings, 2 replies; 14+ messages in thread
From: Steffen Maier @ 2019-09-18 15:09 UTC (permalink / raw)
  To: Martin K. Petersen, Ming Lei, Paolo Bonzini, Mark Brown
  Cc: James E . J . Bottomley, Ming Lei, Linux-Next Mailing List,
	Linux SCSI List, linux-block, open list:DEVICE-MAPPER (LVM),
	linux-s390, Benjamin Block, Heiko Carstens, Vasily Gorbik,
	Bart Van Assche, Hannes Reinecke, Jens Axboe, Ewan D . Milne,
	Christoph Hellwig, Mike Snitzer

On 8/8/19 4:18 AM, Martin K. Petersen wrote:
> 
> Ming,
> 
>>> +       .cleanup_rq     = scsi_cleanup_rq,
>>>          .busy           = scsi_mq_lld_busy,
>>>          .map_queues     = scsi_map_queues,
>>>   };
>>
>> This one is a cross-tree thing, either scsi/5.4/scsi-queue needs to
>> pull for-5.4/block, or do it after both land linus tree.
> 
> I'll set up an amalgamated for-next branch tomorrow.

Martin, is it possible that you re-wrote your for-next and it now no longer 
contains a merged 5.4/scsi-postmerge with those fixes?
At least I cannot find the fix code in next-20190917 and it fails again for me.


-- 
Mit freundlichen Gruessen / Kind regards
Steffen Maier

Linux on IBM Z Development

https://www.ibm.com/privacy/us/en/
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Matthias Hartmann
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


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

* Re: [PATCH 1/2] scsi: core: fix missing .cleanup_rq for SCSI hosts without request batching
  2019-09-18 15:09       ` Steffen Maier
@ 2019-09-18 15:22         ` Martin K. Petersen
  2019-09-18 15:32         ` Mark Brown
  1 sibling, 0 replies; 14+ messages in thread
From: Martin K. Petersen @ 2019-09-18 15:22 UTC (permalink / raw)
  To: Steffen Maier
  Cc: Martin K. Petersen, Ming Lei, Paolo Bonzini, Mark Brown,
	James E . J . Bottomley, Ming Lei, Linux-Next Mailing List,
	Linux SCSI List, linux-block, open list\:DEVICE-MAPPER \(LVM\),
	linux-s390, Benjamin Block, Heiko Carstens, Vasily Gorbik,
	Bart Van Assche, Hannes Reinecke, Jens Axboe, Ewan D . Milne,
	Christoph Hellwig, Mike Snitzer


Steffen,

> Martin, is it possible that you re-wrote your for-next and it now no
> longer contains a merged 5.4/scsi-postmerge with those fixes?  At
> least I cannot find the fix code in next-20190917 and it fails again
> for me.

Yes, looks like you're right. Not sure how I managed to mess that up. I
must have inadvertently done a reset in the wrong worktree because my
for-next branch maintenance script only does merges.

In any case, since Linus has pulled the block tree dependencies, I'll
rebase the postmerge branch on top of current linus/master and create a
new for-next.

Thanks for the heads-up!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH 1/2] scsi: core: fix missing .cleanup_rq for SCSI hosts without request batching
  2019-09-18 15:09       ` Steffen Maier
  2019-09-18 15:22         ` Martin K. Petersen
@ 2019-09-18 15:32         ` Mark Brown
  1 sibling, 0 replies; 14+ messages in thread
From: Mark Brown @ 2019-09-18 15:32 UTC (permalink / raw)
  To: Steffen Maier
  Cc: Martin K. Petersen, Ming Lei, Paolo Bonzini,
	James E . J . Bottomley, Ming Lei, Linux-Next Mailing List,
	Linux SCSI List, linux-block, open list:DEVICE-MAPPER (LVM),
	linux-s390, Benjamin Block, Heiko Carstens, Vasily Gorbik,
	Bart Van Assche, Hannes Reinecke, Jens Axboe, Ewan D . Milne,
	Christoph Hellwig, Mike Snitzer

[-- Attachment #1: Type: text/plain, Size: 522 bytes --]

On Wed, Sep 18, 2019 at 05:09:50PM +0200, Steffen Maier wrote:
> On 8/8/19 4:18 AM, Martin K. Petersen wrote:

> > I'll set up an amalgamated for-next branch tomorrow.

> Martin, is it possible that you re-wrote your for-next and it now no longer
> contains a merged 5.4/scsi-postmerge with those fixes?
> At least I cannot find the fix code in next-20190917 and it fails again for me.

Well, there's no sign of a branch called postmerge in the SCSI history
recently and I've not run into any SCSI-related conflicts so...

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, back to index

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-07 14:49 [PATCH 0/2] scsi: core: regression fixes for request batching Steffen Maier
2019-08-07 14:49 ` [PATCH 1/2] scsi: core: fix missing .cleanup_rq for SCSI hosts without " Steffen Maier
2019-08-07 23:32   ` Ming Lei
2019-08-08  2:18     ` Martin K. Petersen
2019-09-18 15:09       ` Steffen Maier
2019-09-18 15:22         ` Martin K. Petersen
2019-09-18 15:32         ` Mark Brown
2019-08-08  5:52   ` kbuild test robot
2019-08-09  1:56   ` kbuild test robot
2019-08-07 14:49 ` [PATCH 2/2] scsi: core: fix dh and multipathing " Steffen Maier
2019-08-08  6:02   ` kbuild test robot
2019-08-09  9:08   ` kbuild test robot
2019-08-07 16:17 ` [PATCH 0/2] scsi: core: regression fixes for " Paolo Bonzini
2019-08-07 17:08 ` Bart Van Assche

Linux-Next Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-next/0 linux-next/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-next linux-next/ https://lore.kernel.org/linux-next \
		linux-next@vger.kernel.org
	public-inbox-index linux-next

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-next


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git