Skip to contentSkip to conversation

linux-next: build failure after merge of the block tree

PATCH Stephen Rothwell 3 participants 3 messages Sep 19, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi Jens,

After merging the block tree, today's linux-next build (powerpc allnoconfig) failed like this:

In file included from block/blk-mq-pci.c:13:0:
include/linux/blk-mq.h:57:18: error: field 'kobj' has incomplete type

  struct kobject  kobj;
                  ^

include/linux/blk-mq.h:121:2: error: unknown type name 'softirq_done_fn'
softirq_done_fn *complete;
^
include/linux/blk-mq.h: In function 'blk_mq_rq_from_pdu':
include/linux/blk-mq.h:253:22: error: invalid application of 'sizeof' to incomplete type 'struct request'

  return pdu - sizeof(struct request);
                      ^

include/linux/blk-mq.h: In function 'blk_mq_rq_to_pdu':
include/linux/blk-mq.h:257:2: error: invalid use of undefined type 'struct request'
return rq + 1;
^

Caused by commit

973c4e372c8f ("blk-mq: provide a default queue mapping for PCI device")

include/linux/blk-mq.h does not include all the headers files that it depends on, and building block/blk-mq-pci.c should depend on CONFIG_BLOCK.

I applied this fix patch (the block/blk-mq-pci.c may not be becessary):

From: Stephen Rothwell <[email protected]>
Date: Mon, 19 Sep 2016 15:50:16 +1000
Subject: [PATCH] blk_mq: linux/blk-mq.h does not include all the headers it
depends on

and building block/blk-mq-pci.o should depend on CONFIG_BLOCK

Fixes 973c4e372c8f ("blk-mq: provide a default queue mapping for PCI device")
---
 block/Kconfig      | 5 +++++
 block/Makefile     | 2 +-
 block/blk-mq-pci.c | 2 ++
 3 files changed, 8 insertions(+), 1 deletion(-)
block/Kconfig +5 -0
index 5136ad4bb6d5..1d4d624492fc 100644
@@ -125,4 +125,9 @@ config BLOCK_COMPAT
 	depends on BLOCK && COMPAT
 	default y
 
+config BLK_MQ_PCI
+	bool
+	depends on BLOCK && PCI
+	default y
+
 source block/Kconfig.iosched
block/Makefile +1 -1
index 2447a0b1ef9c..37a0d93f97bb 100644
@@ -22,4 +22,4 @@ obj-$(CONFIG_IOSCHED_CFQ)	+= cfq-iosched.o
 obj-$(CONFIG_BLOCK_COMPAT)	+= compat_ioctl.o
 obj-$(CONFIG_BLK_CMDLINE_PARSER)	+= cmdline-parser.o
 obj-$(CONFIG_BLK_DEV_INTEGRITY) += bio-integrity.o blk-integrity.o t10-pi.o
-obj-$(CONFIG_PCI)		+= blk-mq-pci.o
+obj-$(CONFIG_BLK_MQ_PCI)	+= blk-mq-pci.o
block/blk-mq-pci.c +2 -0
index 33c7bd743c63..966c2169762e 100644
@@ -10,6 +10,8 @@
  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  * more details.
  */
+#include <linux/kobject.h>
+#include <linux/blkdev.h>
 #include <linux/blk-mq.h>
 #include <linux/blk-mq-pci.h>
 #include <linux/pci.h>
Signature · 5 lines
2.8.1

-- 
Cheers,
Stephen Rothwell
Reviewed-by
#1 lore raw

Thanks Stephen,

the fix looks good to me:

I had actually seen the error earlier, but for the setups I got builbot results moving the code to this new pci-dependent file fixed it. I guess that didn't went far enough.

maintainer
#2 lore raw
In reply to Stephen Rothwell
Quoted 21 lines · Stephen Rothwell

Hi Jens,

After merging the block tree, today's linux-next build (powerpc allnoconfig) failed like this:

In file included from block/blk-mq-pci.c:13:0:
include/linux/blk-mq.h:57:18: error: field 'kobj' has incomplete type

  struct kobject  kobj;
                  ^

include/linux/blk-mq.h:121:2: error: unknown type name 'softirq_done_fn'
softirq_done_fn *complete;
^
include/linux/blk-mq.h: In function 'blk_mq_rq_from_pdu':
include/linux/blk-mq.h:253:22: error: invalid application of 'sizeof' to incomplete type 'struct request'

  return pdu - sizeof(struct request);
                      ^

include/linux/blk-mq.h: In function 'blk_mq_rq_to_pdu':
include/linux/blk-mq.h:257:2: error: invalid use of undefined type 'struct request'
return rq + 1;
^

Quoted 8 lines

Caused by commit

973c4e372c8f ("blk-mq: provide a default queue mapping for PCI device")

include/linux/blk-mq.h does not include all the headers files that it depends on, and building block/blk-mq-pci.c should depend on CONFIG_BLOCK.

I applied this fix patch (the block/blk-mq-pci.c may not be becessary):

Added, thanks Stephen.

Signature · 1 line
Jens Axboe