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

Won't compile on Rocky Linux 9.2, kernel 5.14.0-284.18.1.el9_2.x86_64 #1452

Closed maltenizer closed 1 month ago

maltenizer commented 1 year ago

Description

Won't compile on Rocky Linux 9.2

Expected Behavior

Compile and install

Actual Behavior

[root@BOX open-cas-linux]# make . . . .

cd "/lib/modules/"5.14.0-284.18.1.el9_2.x86_64"/build" && make M=/root/open-cas-linux/modules modules make[2]: Entering directory '/usr/src/kernels/5.14.0-284.18.1.el9_2.x86_64' CC [M] /root/open-cas-linux/modules/cas_cache/classifier.o CC [M] /root/open-cas-linux/modules/cas_cache/context.o CC [M] /root/open-cas-linux/modules/cas_cache/control.o CC [M] /root/open-cas-linux/modules/cas_cache/disk.o CC [M] /root/open-cas-linux/modules/cas_cache/exp_obj.o 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:10, 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:16, 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:12, from /root/open-cas-linux/modules/cas_cache/exp_obj.c:12: /root/open-cas-linux/modules/cas_cache/exp_obj.c:296:28: error: initialization of ‘void ()(struct bio )’ from incompatible pointer type ‘blk_qc_t ()(struct bio )’ {aka ‘unsigned int ()(struct bio )’} [-Werror=incompatible-pointer-types] 296 | CAS_SET_SUBMIT_BIO(_cas_exp_obj_submit_bio) | ^~~~~~~ /root/open-cas-linux/modules/generated_defines.h:192:47: note: in definition of macro ‘CAS_SET_SUBMIT_BIO’ 192 | #define CAS_SET_SUBMIT_BIO(_fn) .submit_bio = _fn, | ^~~ /root/open-cas-linux/modules/cas_cache/exp_obj.c:296:28: note: (near initialization for ‘_cas_exp_obj_ops.submit_bio’) 296 | CAS_SET_SUBMIT_BIO(_cas_exp_obj_submit_bio) | ^~~~~~~ /root/open-cas-linux/modules/generated_defines.h:192:47: note: in definition of macro ‘CAS_SET_SUBMIT_BIO’ 192 | #define CAS_SET_SUBMIT_BIO(_fn) .submit_bio = _fn, | ^~~ cc1: all warnings being treated as errors make[4]: [scripts/Makefile.build:321: /root/open-cas-linux/modules/cas_cache/exp_obj.o] Error 1 make[3]: [scripts/Makefile.build:607: /root/open-cas-linux/modules/cas_cache] Error 2 make[2]: [Makefile:1923: /root/open-cas-linux/modules] Error 2 make[2]: Leaving directory '/usr/src/kernels/5.14.0-284.18.1.el9_2.x86_64' make[1]: [Makefile:46: default] Error 2 make[1]: Leaving directory '/root/open-cas-linux/modules' make: *** [Makefile:22: modules] Error 2

Steps to Reproduce

see above

Your Environment

Rocky Linux 9.2 uname -a Linux BOX.localdomain 5.14.0-284.18.1.el9_2.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jun 22 17:36:46 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

gcc version 11.3.1 20221121 (Red Hat 11.3.1-4) (GCC)

I'm a bit of a noob so might missed to include som important information.

robertbaldyga commented 4 months ago

We never tested on Rocky Linux. But we recently added support for broader range of kernels, so it's worth trying with the current master branch.

MJAsadi72 commented 3 months ago

Hi everyone. I tested the maste branch ba5bdf4 on rocky 9 with kernel 5.14.0-427.16.1.el9_4.x86_64 and I think got the same error.

cd modules && make 
make[1]: Entering directory '/root/open-cas-linux/modules'
make[2]: Entering directory '/root/open-cas-linux/ocf'
make[3]: Entering directory '/root/open-cas-linux/ocf'
make[3]: Nothing to be done for 'distcleandir'.
make[3]: Leaving directory '/root/open-cas-linux/ocf'
make[2]: Leaving directory '/root/open-cas-linux/ocf'
make[2]: Entering directory '/root/open-cas-linux/ocf'
make[3]: Entering directory '/root/open-cas-linux/ocf'
make[3]: Nothing to be done for 'distcleandir'.
make[3]: Leaving directory '/root/open-cas-linux/ocf'
make[2]: Leaving directory '/root/open-cas-linux/ocf'
cd "/lib/modules/"5.14.0-427.16.1.el9_4.x86_64"/build" && make M=/root/open-cas-linux/modules modules
make[2]: Entering directory '/usr/src/kernels/5.14.0-427.16.1.el9_4.x86_64'
  CC [M]  /root/open-cas-linux/modules/cas_cache/service_ui_ioctl.o
  CC [M]  /root/open-cas-linux/modules/cas_cache/control.o
  CC [M]  /root/open-cas-linux/modules/cas_cache/classifier.o
  CC [M]  /root/open-cas-linux/modules/cas_cache/exp_obj.o
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/cas_cache/exp_obj.c:297:28: error: initialization of ‘void (*)(struct bio *)’ from incompatible pointer type ‘blk_qc_t (*)(struct bio *)’ {aka ‘unsigned int (*)(struct bio *)’} [-Werror=incompatible-pointer-types]
  297 |         CAS_SET_SUBMIT_BIO(_cas_exp_obj_submit_bio)
      |                            ^~~~~~~~~~~~~~~~~~~~~~~
/root/open-cas-linux/modules/generated_defines.h:205:47: note: in definition of macro ‘CAS_SET_SUBMIT_BIO’
  205 | #define CAS_SET_SUBMIT_BIO(_fn) .submit_bio = _fn,
      |                                               ^~~
/root/open-cas-linux/modules/cas_cache/exp_obj.c:297:28: note: (near initialization for ‘_cas_exp_obj_ops.submit_bio’)
  297 |         CAS_SET_SUBMIT_BIO(_cas_exp_obj_submit_bio)
      |                            ^~~~~~~~~~~~~~~~~~~~~~~
/root/open-cas-linux/modules/generated_defines.h:205:47: note: in definition of macro ‘CAS_SET_SUBMIT_BIO’
  205 | #define CAS_SET_SUBMIT_BIO(_fn) .submit_bio = _fn,
      |                                               ^~~
cc1: all warnings being treated as errors
make[4]: *** [scripts/Makefile.build:299: /root/open-cas-linux/modules/cas_cache/exp_obj.o] Error 1
make[3]: *** [scripts/Makefile.build:585: /root/open-cas-linux/modules/cas_cache] Error 2
make[2]: *** [Makefile:1934: /root/open-cas-linux/modules] Error 2
make[2]: Leaving directory '/usr/src/kernels/5.14.0-427.16.1.el9_4.x86_64'
make[1]: *** [Makefile:46: default] Error 2
make[1]: Leaving directory '/root/open-cas-linux/modules'
make: *** [Makefile:22: modules] Error 2

GCC version: gcc (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3) kernel version: 5.14.0-427.16.1.el9_4.x86_64

aneagoe commented 2 months ago

Looks like this is addressed in https://github.com/Open-CAS/open-cas-linux/pull/1470. Would be great if it could be reviewed and merged. Either way, you could try to just apply the patch and continue.

aneagoe commented 2 months ago

This has been merged recently. I've tested, and it compiles, loads and works fine on a CentOS Stream9 install (build from master). It would be great to see a release including this fix, but the issue can be considered resolved.