Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bcachefs patchset breaks the build for both kernel with default config and ZFS kmod #152

Closed
extSunset opened this issue Aug 11, 2023 · 18 comments

Comments

@extSunset
Copy link
Contributor

extSunset commented Aug 11, 2023

The bcachefs patch causes problems when building the IVPU kernel module. By default, CONFIG_DRM_ACCEL_IVPU is set to m for kernel version 6.4+ (tested on 6.4.{9,10}). Build errors:

drivers/accel/ivpu/ivpu_gem.c:200:17: error: expected identifier
        ret = bo->ops->alloc_pages(bo);
                       ^
./include/linux/gfp.h:288:28: note: expanded from macro 'alloc_pages'
#define alloc_pages(...)                        alloc_hooks(alloc_pages_noprof(VA_ARGS))
                                                ^
./include/linux/alloc_tag.h:150:37: note: expanded from macro 'alloc_hooks'
#define alloc_hooks(_do_alloc)                                          \
                                                                        ^
drivers/accel/ivpu/ivpu_gem.c:200:17: error: expected expression 
./include/linux/gfp.h:288:28: note: expanded from macro 'alloc_pages'
#define alloc_pages(...)                        alloc_hooks(alloc_pages_noprof(VA_ARGS))
                                                ^
./include/linux/alloc_tag.h:151:2: note: expanded from macro 'alloc_hooks'
({                                                                      \
^
2 errors generated.

Also, the patchset prevents the ZFS kernel module from being built (tested on zfs-dkms 2.1.12 and 2.2.0-rc3, commit f9a2d94 via the internal linux-cachyos ZFS package). Build errors:

/var/lib/dkms/zfs-2.2.0/rc3/build/module/os/linux/spl/spl-kmem-cache.c:1252:10: error: call to undeclared function 'kmem_cache_alloc'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                        obj = kmem_cache_alloc(slc, kmem_flags_convert(flags));
                              ^
/var/lib/dkms/zfs-2.2.0/rc3/build/module/os/linux/spl/spl-kmem-cache.c:1252:8: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
                        obj = kmem_cache_alloc(slc, kmem_flags_convert(flags));
                              ^ ~~~~~~~~~~~~

Tested when building with LLVM 15.0.7 and 16.0.3.
The issue may also apply to the LTS version of the kernel.

@sirlucjan
Copy link
Member

I think these errors are more eligible to be reported to bcachefs developers. Regarding the lack of compatibility of bcachefs with zfs, we are unable to resolve anything.

@extSunset
Copy link
Contributor Author

There is no support for ZFS compatibility, yes. But IVPU is an in-built kernel module, in the case of Arch Linux it is enabled by default. My suggestion for now is to mutually disable building ZFS and Bcachefs together, and when building with the latter, disable CONFIG_DRM_ACCEL_IVPU and display a warning about this issue.

@extSunset
Copy link
Contributor Author

I will pass the problem on to the bcachefs developers.

@extSunset
Copy link
Contributor Author

Could you please tell me the commit in the bcachefs repository that you used for patch?

@sirlucjan
Copy link
Member

Latest one currently.

@extSunset
Copy link
Contributor Author

extSunset commented Aug 11, 2023

Seems like there is no need for me to submit it, it's a pretty old issue: koverstreet/bcachefs#573

@extSunset
Copy link
Contributor Author

extSunset commented Aug 11, 2023

According to the mentioned issue, cramfs doesn't build either.

@sirlucjan
Copy link
Member

In a moment I will add an option that will prevent you from trying to build ZFS and bcachefs at the same time.

@sirlucjan
Copy link
Member

sirlucjan commented Aug 12, 2023

@extSunset Could you check latest commits? I added what you asked for.

732d8ed...a353449

@extSunset
Copy link
Contributor Author

@sirlucjan Thank you very much. I think we should leave the issue open for now, as it is more of a temporary solution than a permanent one.

@sirlucjan
Copy link
Member

I did as much as I was able to do - the rest of the work belongs to the developers.

@sirlucjan
Copy link
Member

@extSunset

Could you check if the error still occurs without applying this workaround? It has reportedly been resolved.

@sirlucjan
Copy link
Member

I checked, it seems to be working.

@sirlucjan
Copy link
Member

So I've reverted one workaround for bcachefs (related to config): a4638a2

@extSunset
Copy link
Contributor Author

I apologise for such a late reply. It seems to be working while building with IVPU, but not with ZFS. Thank you.

@sirlucjan
Copy link
Member

Is everything working properly now? Can we remove workaround?

@extSunset
Copy link
Contributor Author

@sirlucjan It seems so. At least when building with GCC.

@sirlucjan
Copy link
Member

@ptr1337 so why not remove the workaround?

sirlucjan added a commit that referenced this issue Nov 3, 2023
sirlucjan added a commit that referenced this issue Nov 3, 2023
Revert: Prevent ZFS and bcachefs building at the same time (issue #152 is solved now)
ventureoo pushed a commit to ventureoo/linux-cachyos that referenced this issue Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants