Open-CAS / open-cas-linux

Open CAS Linux
https://open-cas.com
BSD 3-Clause "New" or "Revised" License
216 stars 82 forks source link

Compilation error on kernel 4.18 #1472

Closed katlapinka closed 1 month ago

katlapinka commented 2 months ago

Description

Error occurs while making master version of OCL:

` CC [M] /root/open-cas-linux/modules/cas_cache/utils/utils_gc.o /root/open-cas-linux/modules/cas_cache/exp_obj.c:85:8: error: unknown type name ‘MAKE_RQ_RET_TYPE’ static MAKE_RQ_RET_TYPE _cas_exp_obj_submit_bio(struct bio bio) ^~~~ /root/open-cas-linux/modules/cas_cache/exp_obj.c: In function ‘_cas_exp_obj_submit_bio’: /root/open-cas-linux/modules/cas_cache/exp_obj.c:96:2: error: implicit declaration of function ‘KRETURN’ [-Werror=implicit-function-declaration] KRETURN(0); ^~~ /root/open-cas-linux/modules/cas_cache/exp_obj.c: At top level: /root/open-cas-linux/modules/cas_cache/exp_obj.c:99:8: error: unknown type name ‘MAKE_RQ_RET_TYPE’ static MAKE_RQ_RET_TYPE _cas_exp_obj_make_rq_fn(struct request_queue q, ^~~~ /root/open-cas-linux/modules/cas_cache/exp_obj.c: In function ‘_cas_exp_obj_make_rq_fn’: /root/open-cas-linux/modules/cas_cache/exp_obj.c:105:1: error: no return statement in function returning non-void [-Werror=return-type] } ^ /root/open-cas-linux/modules/cas_cache/exp_obj.c: In function ‘cas_exp_obj_create’: /root/open-cas-linux/modules/cas_cache/exp_obj.c:489:36: error: passing argument 2 of ‘cas_blk_queue_make_request’ from incompatible pointer type [-Werror=incompatible-pointer-types] cas_blk_queue_make_request(queue, _cas_exp_obj_make_rq_fn); ^~~~~~~ In file included from /root/open-cas-linux/modules/cas_cache/linux_kernel_version.h:44, from /root/open-cas-linux/modules/cas_cache/ocf_env.h:11, from /root/open-cas-linux/modules/include/ocf/ocf_logger.h:14, from /root/open-cas-linux/modules/include/ocf/ocf_ctx.h:15, from /root/open-cas-linux/modules/include/ocf/ocf_cache.h:17, from /root/open-cas-linux/modules/include/ocf/ocf.h:22, from /root/open-cas-linux/modules/cas_cache/cas_cache.h:9, from /root/open-cas-linux/modules/cas_cache/disk.h:13, from /root/open-cas-linux/modules/cas_cache/exp_obj.c:13: /root/open-cas-linux/modules/generated_defines.h:173:34: note: expected ‘blk_qc_t ()(struct request_queue , struct bio )’ {aka ‘unsigned int ()(struct request_queue , struct bio )’} but argument is of type ‘int ()(struct request_queue , struct bio )’ make_request_fn mfn)


/root/open-cas-linux/modules/cas_cache/exp_obj.c: In function ‘_cas_exp_obj_submit_bio’:
/root/open-cas-linux/modules/cas_cache/exp_obj.c:97:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
cc1: all warnings being treated as errors
make[4]: *** [scripts/Makefile.build:317: /root/open-cas-linux/modules/cas_cache/exp_obj.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [scripts/Makefile.build:558: /root/open-cas-linux/modules/cas_cache] Error 2
make[2]: *** [Makefile:1619: _module_/root/open-cas-linux/modules] Error 2
make[2]: Leaving directory '/usr/src/kernels/4.18.0-552.3.1.el8.x86_64'
make[1]: *** [Makefile:46: default] Error 2
make[1]: Leaving directory '/root/open-cas-linux/modules'
make: *** [Makefile:22: modules] Error 2
`

## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
* OpenCAS version (commit hash or tag): 4ad71a55b6b3c10b794a284f0e8c0469abfc1ff4
* Operating System: Centos 8
* Kernel version: 4.18