[sheepdog-users] sbd compilation error: error: unknown field ‘bus_attrs’ specified in initializer, .bus_attrs = sbd_bus_attrs
Marcin Mirosław
marcin at mejor.pl
Fri May 30 11:40:46 CEST 2014
W dniu 30.05.2014 11:25, Liu Yuan pisze:
> On Fri, May 30, 2014 at 10:53:39AM +0200, Marcin Mirosław wrote:
>> Hi!
>> I've got compilation error:
>>
>> # make V=1
>> make -C /lib/modules/`uname -r`/build M=$PWD modules
>> make[1]: Entering directory `/usr/src/linux-3.14.2-hardened-r1'
>> test -e include/generated/autoconf.h -a -e include/config/auto.conf || (
>> \
>> echo >&2; \
>> echo >&2 " ERROR: Kernel configuration is invalid."; \
>> echo >&2 " include/generated/autoconf.h or
>> include/config/auto.conf are missing.";\
>> echo >&2 " Run 'make oldconfig && make prepare' on kernel src to
>> fix it."; \
>> echo >&2 ; \
>> /bin/false)
>> mkdir -p
>> /var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd/.tmp_versions
>> ; rm -f
>> /var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd/.tmp_versions/*
>> make -f scripts/Makefile.build
>> obj=/var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd
>> gcc
>> -Wp,-MD,/var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd/.sheep_block_device.o.d
>> -nostdinc -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/include
>> -I/usr/src/linux-3.14.2-hardened-r1/arch/x86/include
>> -Iarch/x86/include/generated -Iinclude
>> -I/usr/src/linux-3.14.2-hardened-r1/arch/x86/include/uapi
>> -Iarch/x86/include/generated/uapi
>> -I/usr/src/linux-3.14.2-hardened-r1/include/uapi
>> -Iinclude/generated/uapi -include
>> /usr/src/linux-3.14.2-hardened-r1/include/linux/kconfig.h -D__KERNEL__
>> -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing
>> -fno-common -Werror-implicit-function-declaration -Wno-format-security
>> -fno-delete-null-pointer-checks -O2 -m64 -mno-mmx -mno-sse
>> -mpreferred-stack-boundary=3 -march=core2 -mno-red-zone -mcmodel=kernel
>> -funit-at-a-time -maccumulate-outgoing-args -ffreestanding
>> -DCONFIG_X86_X32_ABI -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1
>> -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_AVX=1
>> -DCONFIG_AS_AVX2=1 -pipe -Wno-sign-compare
>> -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
>> -mno-avx -Wframe-larger-than=2048 -fstack-protector
>> -Wno-unused-but-set-variable -fno-omit-frame-pointer
>> -fno-optimize-sibling-calls -g -femit-struct-debug-baseonly
>> -fno-var-tracking -Wdeclaration-after-statement -Wno-pointer-sign
>> -fno-strict-overflow -fconserve-stack -Werror=implicit-int
>> -Werror=strict-prototypes -DCC_HAVE_ASM_GOTO
>> -fplugin=/usr/src/linux-3.14.2-hardened-r1/tools/gcc/constify_plugin.so
>> -DCONSTIFY_PLUGIN
>> -fplugin=/usr/src/linux-3.14.2-hardened-r1/tools/gcc/kernexec_plugin.so
>> -fplugin-arg-kernexec_plugin-method="bts" -DKERNEXEC_PLUGIN
>> -fplugin=/usr/src/linux-3.14.2-hardened-r1/tools/gcc/colorize_plugin.so
>> -fplugin=/usr/src/linux-3.14.2-hardened-r1/tools/gcc/size_overflow_plugin.so
>> -DSIZE_OVERFLOW_PLUGIN
>> -fplugin=/usr/src/linux-3.14.2-hardened-r1/tools/gcc/latent_entropy_plugin.so
>> -DLATENT_ENTROPY_PLUGIN
>> -I/var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd/../include
>> -DMODULE -D"KBUILD_STR(s)=#s"
>> -D"KBUILD_BASENAME=KBUILD_STR(sheep_block_device)"
>> -D"KBUILD_MODNAME=KBUILD_STR(sbd)" -c -o
>> /var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd/sheep_block_device.o
>> /var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd/sheep_block_device.c
>> /var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd/sheep_block_device.c:350:2:
>> error: unknown field ‘bus_attrs’ specified in initializer
>> .bus_attrs = sbd_bus_attrs,
>> ^
>> /var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd/sheep_block_device.c:350:2:
>> warning: initialization from incompatible pointer type [enabled by default]
>> /var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd/sheep_block_device.c:350:2:
>> warning: (near initialization for ‘sbd_bus_type.dev_name’) [enabled by
>> default]
>> make[2]: ***
>> [/var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd/sheep_block_device.o]
>> Error 1
>> make[1]: ***
>> [_module_/var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd]
>> Error 2
>> make[1]: Leaving directory `/usr/src/linux-3.14.2-hardened-r1'
>> make: *** [default] Error 2
>>
>>
>> # gcc -v
>> Using built-in specs.
>> COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.2/gcc
>> COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.2/lto-wrapper
>> Target: x86_64-pc-linux-gnu
>> Configured with:
>> /var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/configure
>> --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
>> --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.2
>> --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/include
>> --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.2
>> --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.2/man
>> --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.2/info
>> --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/include/g++-v4
>> --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.8.2/python
>> --enable-languages=c,c++ --enable-obsolete --enable-secureplt
>> --disable-werror --with-system-zlib --enable-nls
>> --without-included-gettext --enable-checking=release
>> --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo
>> Hardened 4.8.2 p1.3r1, pie-0.5.8r1' --enable-esp --enable-libstdcxx-time
>> --enable-shared --enable-threads=posix --enable-__cxa_atexit
>> --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64
>> --disable-altivec --disable-fixed-point --enable-targets=all
>> --disable-libgcj --enable-libgomp --disable-libmudflap --disable-libssp
>> --disable-libquadmath --enable-lto --with-cloog --disable-isl-version-check
>> Thread model: posix
>> gcc version 4.8.2 (Gentoo Hardened 4.8.2 p1.3r1, pie-0.5.8r1)
>>
>
> It's because kernel with version 3.12+ don't support old bus registration.
>
> I've pushed the fix to origin/sbd. Could you please try it? If is okay, I'll
> post the patch to the list.
Sadly it's not enough:
# make
[39/4633]
make -C /lib/modules/`uname -r`/build M=$PWD modules
make[1]: Entering directory `/usr/src/linux-3.14.2-hardened-r1'
CC [M]
/var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd/sheepdog/sbd/sheep.o
In file included from include/linux/blkdev.h:18:0,
from
/var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd/sheepdog/sbd/sbd.h:15,
from
/var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd/sheepdog/sbd/sheep.c:12:
/var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd/sheepdog/sbd/sheep.c:
In function ‘aio_read_done’:
include/linux/bio.h:239:9: error: incompatible types when assigning to
type ‘struct bio_vec *’ from type ‘struct bio_vec’
((bvl = bio_iter_iovec((bio), (iter))), 1); \
^
include/linux/bio.h:243:2: note: in expansion of macro
‘__bio_for_each_segment’
__bio_for_each_segment(bvl, bio, iter, (bio)->bi_iter)
^
include/linux/blkdev.h:744:3: note: in expansion of macro
‘bio_for_each_segment’
bio_for_each_segment(bvl, _iter.bio, _iter.iter)
^
/var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd/sheepdog/sbd/sheep.c:348:2:
note: in expansion of macro ‘rq_for_each_segment’
rq_for_each_segment(bvec, req, iter) {
^
include/linux/bio.h:239:41: warning: left-hand operand of comma
expression has no effect [-Wunused-value]
((bvl = bio_iter_iovec((bio), (iter))), 1); \
^
include/linux/bio.h:243:2: note: in expansion of macro
‘__bio_for_each_segment’
__bio_for_each_segment(bvl, bio, iter, (bio)->bi_iter)
^
include/linux/blkdev.h:744:3: note: in expansion of macro
‘bio_for_each_segment’
bio_for_each_segment(bvl, _iter.bio, _iter.iter)
^
/var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd/sheepdog/sbd/sheep.c:348:2:
note: in expansion of macro ‘rq_for_each_segment’
rq_for_each_segment(bvec, req, iter) {
^
include/linux/bio.h:240:45: error: request for member ‘bv_len’ in
something not a structure or union
bio_advance_iter((bio), &(iter), (bvl).bv_len))
^
include/linux/bio.h:243:2: note: in expansion of macro
‘__bio_for_each_segment’
__bio_for_each_segment(bvl, bio, iter, (bio)->bi_iter)
^
include/linux/blkdev.h:744:3: note: in expansion of macro
‘bio_for_each_segment’
bio_for_each_segment(bvl, _iter.bio, _iter.iter)
^
/var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd/sheepdog/sbd/sheep.c:348:2:
note: in expansion of macro ‘rq_for_each_segment’
rq_for_each_segment(bvec, req, iter) {
/var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd/sheepdog/sbd/sheep.c:
In function ‘sheep_aiocb_setup’:
include/linux/bio.h:239:9: error: incompatible types when assigning to
type ‘struct bio_vec *’ from type ‘struct bio_vec’
((bvl = bio_iter_iovec((bio), (iter))), 1); \
^
include/linux/bio.h:243:2: note: in expansion of macro
‘__bio_for_each_segment’
__bio_for_each_segment(bvl, bio, iter, (bio)->bi_iter)
^
include/linux/blkdev.h:744:3: note: in expansion of macro
‘bio_for_each_segment’
bio_for_each_segment(bvl, _iter.bio, _iter.iter)
^
/var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd/sheepdog/sbd/sheep.c:389:3:
note: in expansion of macro ‘rq_for_each_segment’
rq_for_each_segment(bvec, req, iter) {
^
include/linux/bio.h:239:41: warning: left-hand operand of comma
expression has no effect [-Wunused-value]
((bvl = bio_iter_iovec((bio), (iter))), 1); \
^
include/linux/bio.h:243:2: note: in expansion of macro
‘__bio_for_each_segment’
__bio_for_each_segment(bvl, bio, iter, (bio)->bi_iter)
^
include/linux/blkdev.h:744:3: note: in expansion of macro
‘bio_for_each_segment’
bio_for_each_segment(bvl, _iter.bio, _iter.iter)
^
/var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd/sheepdog/sbd/sheep.c:389:3:
note: in expansion of macro ‘rq_for_each_segment’
rq_for_each_segment(bvec, req, iter) {
^
include/linux/bio.h:240:45: error: request for member ‘bv_len’ in
something not a structure or union
bio_advance_iter((bio), &(iter), (bvl).bv_len))
^
include/linux/bio.h:243:2: note: in expansion of macro
‘__bio_for_each_segment’
__bio_for_each_segment(bvl, bio, iter, (bio)->bi_iter)
^
include/linux/blkdev.h:744:3: note: in expansion of macro
‘bio_for_each_segment’
bio_for_each_segment(bvl, _iter.bio, _iter.iter)
^
/var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd/sheepdog/sbd/sheep.c:389:3:
note: in expansion of macro ‘rq_for_each_segment’
rq_for_each_segment(bvec, req, iter) {
^
make[2]: ***
[/var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd/sheepdog/sbd/sheep.o]
Error 1
make[1]: ***
[_module_/var/tmp/portage/net-fs/sheepdog-9999/work/sheepdog-9999/sbd/sheepdog/sbd]
Error 2
make[1]: Leaving directory `/usr/src/linux-3.14.2-hardened-r1'
make: *** [default] Error 2
More information about the sheepdog-users
mailing list