linux-next: build failure after merge of the block tree
Subsystems (2)
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
--- block/Kconfig | 5 +++++ block/Makefile | 2 +- block/blk-mq-pci.c | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-)
block/Kconfig +5 -0
@@ -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
@@ -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
@@ -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
Christoph Hellwig
Reviewed-byThanks 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.
Jens Axboe
maintainerQuoted 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 typestruct 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.hdoes not include all the headers files that it depends on, and buildingblock/blk-mq-pci.cshould depend onCONFIG_BLOCK.I applied this fix patch (the
block/blk-mq-pci.cmay not be becessary):
Added, thanks Stephen.
Signature · 1 line
Jens Axboe