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

Linux 6.8 compat #15805

Closed
wants to merge 6 commits into from
Closed

Linux 6.8 compat #15805

wants to merge 6 commits into from

Conversation

robn
Copy link
Member

@robn robn commented Jan 23, 2024

Motivation and Context

Linux 6.8 release candidates are starting to appear, with the usual mixed bag of API changes. This PR makes the adjustments required on our side.

Closes #15803

Description

See individual commits. Summary:

  • make configure tests buildable with -Werror -Wmissing-prototypes
  • update for new block_device acquire/release functions
  • implement a strlcpy() fallback
  • handle MAX_ORDER rename
  • fix inode_operations..permission tests
  • handle mnt_idmap and user_namespace decoupling

This gets things working up to 6.8-rc1.

How Has This Been Tested?

Compiled and light sanity check run (create pool, short fio read/write cycle, export, import, scrub) against kernel versions:

  • 6.8-rc1
  • 6.7-rc6
  • 5.10.170
  • 4.9.337

Seems not totally wrong at least.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@robn robn marked this pull request as draft January 23, 2024 11:43
@robn
Copy link
Member Author

robn commented Jan 23, 2024

@behlendorf if it suits you, I will leave this in draft and keep updating it until near or at 6.8.0 release.

@robn
Copy link
Member Author

robn commented Jan 23, 2024

@youzhongyang Hi! You did the mnt_idmap compat work for 6.3. I do not really know very much about id maps at all. If you have time & interest, I would love it if you could have a look at what I've done and tell me if it makes sense. Thanks!

@youzhongyang
Copy link
Contributor

@youzhongyang Hi! You did the mnt_idmap compat work for 6.3. I do not really know very much about id maps at all. If you have time & interest, I would love it if you could have a look at what I've done and tell me if it makes sense. Thanks!

I roughly looked at the changes in Linux kernel, and this PR, more need to be done for idmap to work. I will come back later with more details.

@greg-hydrogen
Copy link

I just tried building with this patch and I am still getting errors
CC [M] /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/icp/algs/blake3/blake3_generic.o
In file included from /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/module/os/linux/spl/spl-kmem-cache.c:31:
/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/include/os/linux/spl/sys/string.h:45:2: error: #error "no strlcpy fallback available"
45 | #error "no strlcpy fallback available"
| ^~~~~
In file included from /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/module/os/linux/spl/spl-zone.c:33:
/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/include/os/linux/spl/sys/string.h:45:2: error: #error "no strlcpy fallback available"
45 | #error "no strlcpy fallback available"
| ^~~~~
In file included from /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/module/os/linux/spl/spl-thread.c:29:
/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/include/os/linux/spl/sys/string.h:45:2: error: #error "no strlcpy fallback available"
45 | #error "no strlcpy fallback available"
| ^~~~~
/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/module/os/linux/spl/spl-zone.c: In function ‘zone_dataset_attach’:
/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/module/os/linux/spl/spl-zone.c:208:9: error: implicit declaration of function ‘strlcpy’; did you mean ‘strscpy’? [-Werror=implicit-function-declaration]
208 | strlcpy(zd->zd_dsname, dataset, dsnamelen + 1);
| ^~~~~~~
| strscpy
/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/module/os/linux/spl/spl-thread.c: In function ‘__thread_create’:
/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/module/os/linux/spl/spl-thread.c:96:9: error: implicit declaration of function ‘strlcpy’; did you mean ‘strscpy’? [-Werror=implicit-function-declaration]
96 | strlcpy(tp->tp_name, name, tp->tp_name_size);
| ^~~~~~~
| strscpy
CC [M] /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/icp/algs/blake3/blake3_impl.o
cc1: some warnings being treated as errors
cc1: some warnings being treated as errors
In file included from /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/module/os/linux/spl/spl-kstat.c:35:
/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/include/os/linux/spl/sys/string.h:45:2: error: #error "no strlcpy fallback available"
45 | #error "no strlcpy fallback available"
| ^~~~~
make[7]: *** [scripts/Makefile.build:243: /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/os/linux/spl/spl-thread.o] Error 1
make[7]: *** Waiting for unfinished jobs....
make[7]: *** [scripts/Makefile.build:243: /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/os/linux/spl/spl-zone.o] Error 1
/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/module/os/linux/spl/spl-kstat.c: In function ‘kstat_create_module’:
/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/module/os/linux/spl/spl-kstat.c:394:9: error: implicit declaration of function ‘strlcpy’; did you mean ‘strscpy’? [-Werror=implicit-function-declaration]
394 | strlcpy(module->ksm_name, name, KSTAT_STRLEN);
| ^~~~~~~
| strscpy
cc1: some warnings being treated as errors
/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/module/os/linux/spl/spl-kmem-cache.c: In function ‘spl_kmem_cache_create’:
/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/module/os/linux/spl/spl-kmem-cache.c:703:9: error: implicit declaration of function ‘strlcpy’; did you mean ‘strscpy’? [-Werror=implicit-function-declaration]
703 | strlcpy(skc->skc_name, name, skc->skc_name_size);
| ^~~~~~~
| strscpy
make[7]: *** [scripts/Makefile.build:243: /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/os/linux/spl/spl-kstat.o] Error 1
cc1: some warnings being treated as errors
make[7]: *** [scripts/Makefile.build:243: /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/os/linux/spl/spl-kmem-cache.o] Error 1
In file included from /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/include/sys/zfs_context.h:59,
from /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/module/icp/include/aes/aes_impl.h:37,
from /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/module/icp/algs/aes/aes_impl_generic.c:25:
/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/include/os/linux/spl/sys/string.h:45:2: error: #error "no strlcpy fallback available"
45 | #error "no strlcpy fallback available"
| ^~~~~
In file included from /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/include/sys/zfs_context.h:59,
from /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/module/icp/algs/blake3/blake3.c:29:
/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/include/os/linux/spl/sys/string.h:45:2: error: #error "no strlcpy fallback available"
45 | #error "no strlcpy fallback available"
| ^~~~~
In file included from /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/module/os/linux/spl/spl-generic.c:46:
/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/include/os/linux/spl/sys/string.h:45:2: error: #error "no strlcpy fallback available"
45 | #error "no strlcpy fallback available"
| ^~~~~
In file included from /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/include/sys/zfs_context.h:59,
from /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/module/icp/algs/aes/aes_modes.c:26:
/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/include/os/linux/spl/sys/string.h:45:2: error: #error "no strlcpy fallback available"
45 | #error "no strlcpy fallback available"
| ^~~~~
make[7]: *** [scripts/Makefile.build:243: /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/os/linux/spl/spl-generic.o] Error 1
make[7]: *** [scripts/Makefile.build:243: /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/icp/algs/blake3/blake3.o] Error 1
In file included from /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/include/sys/zfs_context.h:59,
from /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/module/icp/algs/aes/aes_impl.c:25:
/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/include/os/linux/spl/sys/string.h:45:2: error: #error "no strlcpy fallback available"
45 | #error "no strlcpy fallback available"
| ^~~~~
make[7]: *** [scripts/Makefile.build:243: /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/icp/algs/aes/aes_modes.o] Error 1
make[7]: *** [scripts/Makefile.build:243: /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/icp/algs/aes/aes_impl_generic.o] Error 1
/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/module/icp/algs/aes/aes_impl.c: In function ‘aes_impl_init’:
/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/module/icp/algs/aes/aes_impl.c:332:9: error: implicit declaration of function ‘strlcpy’; did you mean ‘strscpy’? [-Werror=implicit-function-declaration]
332 | strlcpy(aes_fastest_impl.name, "fastest", AES_IMPL_NAME_MAX);
| ^~~~~~~
| strscpy
cc1: some warnings being treated as errors
make[7]: *** [scripts/Makefile.build:243: /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/icp/algs/aes/aes_impl.o] Error 1
In file included from /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/include/sys/zfs_context.h:59,
from /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/module/icp/algs/blake3/blake3_generic.c:29:
/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/include/os/linux/spl/sys/string.h:45:2: error: #error "no strlcpy fallback available"
45 | #error "no strlcpy fallback available"
| ^~~~~
In file included from /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/include/sys/zfs_context.h:59,
from /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/module/icp/algs/blake3/blake3_impl.c:27:
/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/../zfs-2.2.99/include/os/linux/spl/sys/string.h:45:2: error: #error "no strlcpy fallback available"
45 | #error "no strlcpy fallback available"
| ^~~~~
make[7]: *** [scripts/Makefile.build:243: /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/icp/algs/blake3/blake3_generic.o] Error 1
make[7]: *** [scripts/Makefile.build:243: /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/icp/algs/blake3/blake3_impl.o] Error 1
make[6]: *** [/usr/src/kernels/6.8.0-rc1/Makefile:1917: /tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module] Error 2
make[5]: *** [Makefile:240: __sub-make] Error 2
make[5]: Leaving directory '/usr/src/kernels/6.8.0-rc1'
make[4]: *** [Makefile:56: modules-Linux] Error 2
make[4]: Leaving directory '/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module'
make[3]: *** [Makefile:12242: all-recursive] Error 1
make[3]: Leaving directory '/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1'
make[2]: *** [Makefile:4634: all] Error 2
make[2]: Leaving directory '/tmp/zfs-build-greg-YGDehErS/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1'
error: Bad exit status from /tmp/zfs-build-greg-YGDehErS/TMP/rpm-tmp.yAuXN9 (%build)

RPM build warnings:
source_date_epoch_from_changelog set but %changelog is missing

RPM build errors:
Bad exit status from /tmp/zfs-build-greg-YGDehErS/TMP/rpm-tmp.yAuXN9 (%build)
make[1]: *** [Makefile:14414: rpm-common] Error 1
make[1]: Leaving directory '/home/greg/zfs-23-jan-2024-6.8rc1'
make: *** [Makefile:14348: rpm-kmod] Error 2

Any idea?
Thanks,
Greg

@robn
Copy link
Member Author

robn commented Jan 24, 2024

@greg-hydrogen yeah, this happened in some of the CI tests, but I couldn't make it happen locally. Could you post your build/build.log.kabi somewhere please?

@greg-hydrogen
Copy link

@robn - Here you go! thanks for taking a look
https://pastebin.com/Z8ZnY4pf

@robn robn force-pushed the linux-6.8 branch 2 times, most recently from 3526414 to 6e589ec Compare January 24, 2024 02:42
@robn
Copy link
Member Author

robn commented Jan 24, 2024

@greg-hydrogen thanks. Turns out I'd got my strlcpy/strscpy tests wrong. Not so wrong that they made a difference, but wrong enough that compiling with CONFIG_FORTIFY_SOURCE would break the build. Latest push should sort it out.

@greg-hydrogen
Copy link

odd.. still not working for me, this is new though
/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/spl.o: warning: objtool: spl_kmem_cache_create+0x600: spl_panic() is missing a __noreturn annotation
/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/spl.o: warning: objtool: spl_kmem_cache_destroy+0x218: spl_panic() is missing a __noreturn annotation
/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/spl.o: warning: objtool: kstat_seq_data_addr+0x77: spl_panic() is missing a __noreturn annotation
/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/spl.o: warning: objtool: kstat_seq_show+0x137: spl_panic() is missing a __noreturn annotation
/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/spl.o: warning: objtool: __kstat_create+0x2e7: spl_panic() is missing a __noreturn annotation
/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/spl.o: warning: objtool: kstat_seq_start+0x369: spl_panic() is missing a __noreturn annotation
/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/spl.o: warning: objtool: __kstat_delete+0x7e: spl_panic() is missing a __noreturn annotation
/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/spl.o: warning: objtool: taskq_destroy+0x1cf: spl_panic() is missing a __noreturn annotation
/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/spl.o: warning: objtool: taskq_create_synced+0xcb: spl_panic() is missing a __noreturn annotation
LD [M] /tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/zfs.o
/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/zfs.o: warning: objtool: luaD_throw() falls through to next function resume_error()
/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/zfs.o: warning: objtool: zfs_sha256_transform_x64+0x1d: unsupported stack pointer realignment
/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/zfs.o: warning: objtool: zfs_sha256_transform_ssse3+0x1d: unsupported stack pointer realignment
/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/zfs.o: warning: objtool: zfs_sha256_transform_avx+0x1d: unsupported stack pointer realignment
/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/zfs.o: warning: objtool: zfs_sha256_transform_avx2+0x1c: unsupported stack pointer realignment
/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/zfs.o: warning: objtool: zfs_sha512_transform_x64+0x20: unsupported stack pointer realignment
/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/zfs.o: warning: objtool: zfs_sha512_transform_avx+0x20: unsupported stack pointer realignment
/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/zfs.o: warning: objtool: zfs_sha512_transform_avx2+0x1c: unsupported stack pointer realignment
/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/zfs.o: warning: objtool: _aesni_ctr32_ghash_6x+0x57a: return with modified stack frame
/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/zfs.o: warning: objtool: _aesni_ctr32_ghash_no_movbe_6x+0x59a: return with modified stack frame
/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/zfs.o: warning: objtool: aesni_gcm_decrypt+0x48: unsupported stack pointer realignment
/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/zfs.o: warning: objtool: aesni_gcm_encrypt+0x52: unsupported stack pointer realignment
MODPOST /tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/Module.symvers
ERROR: modpost: GPL-incompatible module zfs.ko uses GPL-only symbol 'BUG_func'
make[7]: *** [scripts/Makefile.modpost:145: /tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module/Module.symvers] Error 1
make[6]: *** [/usr/src/kernels/6.8.0-rc1/Makefile:1869: modpost] Error 2
make[5]: *** [Makefile:240: __sub-make] Error 2
make[5]: Leaving directory '/usr/src/kernels/6.8.0-rc1'
make[4]: *** [Makefile:56: modules-Linux] Error 2
make[4]: Leaving directory '/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1/module'
make[3]: *** [Makefile:12242: all-recursive] Error 1
make[3]: Leaving directory '/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1'
make[2]: *** [Makefile:4634: all] Error 2
make[2]: Leaving directory '/tmp/zfs-build-greg-BvQqKRuc/BUILD/zfs-kmod-2.2.99/_kmod_build_6.8.0-rc1'
error: Bad exit status from /tmp/zfs-build-greg-BvQqKRuc/TMP/rpm-tmp.8K6VE9 (%build)

@robn
Copy link
Member Author

robn commented Jan 24, 2024

@greg-hydrogen looks like it might be a bug in rc1, see https://www.spinics.net/lists/kernel/msg5058863.html. Not sure which config option causes it though. I'll wait to see what upstream does. Hopefully they revert it for rc2.

@youzhongyang
Copy link
Contributor

Here is the change that can make idmap work in kernel 6.8:

commit eabc1bb5a1fb69318350f7ae7287c1050e61e374
Author: Youzhong Yang <yyang@mathworks.com>
Date:   Wed Jan 24 12:12:46 2024 -0500

    make id conversion functions aware of mnt_idmap change

diff --git a/include/os/linux/spl/sys/cred.h b/include/os/linux/spl/sys/cred.h
index 2532d1cb1..bf5ac35a3 100644
--- a/include/os/linux/spl/sys/cred.h
+++ b/include/os/linux/spl/sys/cred.h
@@ -73,14 +73,25 @@ static inline struct user_namespace *zfs_i_user_ns(struct inode *inode)
 static inline boolean_t zfs_no_idmapping(struct user_namespace *mnt_userns,
     struct user_namespace *fs_userns)
 {
-       return (mnt_userns == NULL || zfs_is_init_userns(mnt_userns) ||
+       return (zfs_is_init_userns(mnt_userns) ||
            mnt_userns == fs_userns);
 }

 static inline uid_t zfs_uid_to_vfsuid(zidmap_t *mnt_userns,
     struct user_namespace *fs_userns, uid_t uid)
 {
-       struct user_namespace *owner = idmap_owner(mnt_userns);
+       struct user_namespace *owner;
+#if defined(HAVE_IDMAP_NO_USERNS) || defined(HAVE_IOPS_CREATE_IDMAP)
+       if (mnt_userns == zfs_init_idmap)
+               return (uid);
+#endif
+#ifdef HAVE_IDMAP_NO_USERNS
+       struct user_namespace ns;
+       ns.uid_map = mnt_userns->uid_map;
+       owner = &ns;
+#else
+       owner = idmap_owner(mnt_userns);
+#endif
        if (zfs_no_idmapping(owner, fs_userns))
                return (uid);
        if (!zfs_is_init_userns(fs_userns))
@@ -93,7 +104,18 @@ static inline uid_t zfs_uid_to_vfsuid(zidmap_t *mnt_userns,
 static inline gid_t zfs_gid_to_vfsgid(zidmap_t *mnt_userns,
     struct user_namespace *fs_userns, gid_t gid)
 {
-       struct user_namespace *owner = idmap_owner(mnt_userns);
+       struct user_namespace *owner;
+#if defined(HAVE_IDMAP_NO_USERNS) || defined(HAVE_IOPS_CREATE_IDMAP)
+       if (mnt_userns == zfs_init_idmap)
+               return (gid);
+#endif
+#ifdef HAVE_IDMAP_NO_USERNS
+       struct user_namespace ns;
+       ns.gid_map = mnt_userns->gid_map;
+       owner = &ns;
+#else
+       owner = idmap_owner(mnt_userns);
+#endif
        if (zfs_no_idmapping(owner, fs_userns))
                return (gid);
        if (!zfs_is_init_userns(fs_userns))
@@ -106,7 +128,18 @@ static inline gid_t zfs_gid_to_vfsgid(zidmap_t *mnt_userns,
 static inline uid_t zfs_vfsuid_to_uid(zidmap_t *mnt_userns,
     struct user_namespace *fs_userns, uid_t uid)
 {
-       struct user_namespace *owner = idmap_owner(mnt_userns);
+       struct user_namespace *owner;
+#if defined(HAVE_IDMAP_NO_USERNS) || defined(HAVE_IOPS_CREATE_IDMAP)
+       if (mnt_userns == zfs_init_idmap)
+               return (uid);
+#endif
+#ifdef HAVE_IDMAP_NO_USERNS
+       struct user_namespace ns;
+       ns.uid_map = mnt_userns->uid_map;
+       owner = &ns;
+#else
+       owner = idmap_owner(mnt_userns);
+#endif
        if (zfs_no_idmapping(owner, fs_userns))
                return (uid);
        uid = from_kuid(owner, KUIDT_INIT(uid));
@@ -120,7 +153,18 @@ static inline uid_t zfs_vfsuid_to_uid(zidmap_t *mnt_userns,
 static inline gid_t zfs_vfsgid_to_gid(zidmap_t *mnt_userns,
     struct user_namespace *fs_userns, gid_t gid)
 {
-       struct user_namespace *owner = idmap_owner(mnt_userns);
+       struct user_namespace *owner;
+#if defined(HAVE_IDMAP_NO_USERNS) || defined(HAVE_IOPS_CREATE_IDMAP)
+       if (mnt_userns == zfs_init_idmap)
+               return (gid);
+#endif
+#ifdef HAVE_IDMAP_NO_USERNS
+       struct user_namespace ns;
+       ns.gid_map = mnt_userns->gid_map;
+       owner = &ns;
+#else
+       owner = idmap_owner(mnt_userns);
+#endif
        if (zfs_no_idmapping(owner, fs_userns))
                return (gid);
        gid = from_kgid(owner, KGIDT_INIT(gid));

@youzhongyang
Copy link
Contributor

Tested the changes under the following 2 kernels:

6.7.0-68.fc40.x86_64
6.8.0-0.rc1.12.fc40.x86_64

Both "zfs-tests.sh -v -T user_namespace" and "zfs-tests.sh -v -T idmap_mount" passed.

@youzhongyang
Copy link
Contributor

One more improvement:

The following line in the above

#if defined(HAVE_IDMAP_NO_USERNS) || defined(HAVE_IOPS_CREATE_IDMAP)

can be changed to

#ifdef HAVE_IOPS_CREATE_IDMAP

as when HAVE_IDMAP_NO_USERNS is defined, HAVE_IOPS_CREATE_IDMAP is also defined.

@youzhongyang
Copy link
Contributor

For your convenience, the following commit can be cherry-picked:

youzhongyang@9c53818

It has been tested in kernel 6.7 and 6.8 by running tests in 'user_namespace' and 'idmap_mount'.

@greg-hydrogen
Copy link

do you mind providing your kernel .config file so I see why mine is failing and try to build against a working config

@youzhongyang
Copy link
Contributor

I simply edited META file so build can pass.

@behlendorf
Copy link
Contributor

@behlendorf if it suits you, I will leave this in draft and keep updating it until near or at 6.8.0 release.

That works for me.

@behlendorf behlendorf added Type: Building Indicates an issue related to building binaries Status: Code Review Needed Ready for review and testing labels Jan 25, 2024
@robn
Copy link
Member Author

robn commented Jan 26, 2024

@youzhongyang I've merged your suggestion and tested it on multiple kernels, all tests pass. Thank you very much! If you'd like changes to the comment or how I've credited you, please let me know!

@maxximino
Copy link
Contributor

@behlendorf if it suits you, I will leave this in draft and keep updating it until near or at 6.8.0 release.

Since the merge window is closed (rc1 is out), further API changes are much less likely. What about merging it now, and cherrypicking into the (hopefully-soon-to-be-released) 2.2.3, so when it's released we have certain compatibility with kernel 6.7 and high likelyhood of compatibility with 6.8 (at user's risk) as soon as it's released? (to be clear: i do not suggest updating -META for 6.8 until after the release)

@youzhongyang
Copy link
Contributor

@youzhongyang I've merged your suggestion and tested it on multiple kernels, all tests pass. Thank you very much! If you'd like changes to the comment or how I've credited you, please let me know!

The comment looks good to me. Speaking of credits in the final commit, I am not sure how it is handled in openzfs, I remember there is something called 'Co-Authored-By'.

Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just one small nit. As @maxximino said since rc1 is out breaking changes are much less likely so I'm fine pulling this in to master to soak. Assuming everything holds up well we can also look in to backporting them potentially for 2.2.3.

module/os/linux/zfs/vdev_disk.c Outdated Show resolved Hide resolved
robn added 2 commits January 27, 2024 16:07
The kernel is now being compiled with -Wmissing-prototypes. Most of our
test stub functions had no prototype, and failed to compile. Since they
don't need to be visible anywhere else, just make them all static.

Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
blkdev_get_by_path() and blkdev_put() have been replaced by
bdev_open_by_path() and bdev_release(), which return a "handle" object
with the bdev object itself inside.

This adds detection for the new functions, and macros to handle the old
and new forms consistently.

Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
@robn robn mentioned this pull request Feb 7, 2024
13 tasks
robn added a commit to robn/zfs that referenced this pull request Feb 8, 2024
Linux has removed strlcpy in favour of strscpy. This implements a
fallback implementation of strlcpy for this case.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes openzfs#15805
(cherry picked from commit 7466e09)
robn added a commit to robn/zfs that referenced this pull request Feb 8, 2024
MAX_ORDER has been renamed to MAX_PAGE_ORDER. Rather than just
redefining it, instead define our own name and set it consistently from
the start.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes openzfs#15805
(cherry picked from commit 09e6724)
tonyhutter pushed a commit that referenced this pull request Feb 8, 2024
The kernel is now being compiled with -Wmissing-prototypes. Most of our
test stub functions had no prototype, and failed to compile. Since they
don't need to be visible anywhere else, just make them all static.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes #15805
(cherry picked from commit 64afc4e)
tonyhutter pushed a commit that referenced this pull request Feb 8, 2024
blkdev_get_by_path() and blkdev_put() have been replaced by
bdev_open_by_path() and bdev_release(), which return a "handle" object
with the bdev object itself inside.

This adds detection for the new functions, and macros to handle the old
and new forms consistently.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes #15805
(cherry picked from commit ce782d0)
tonyhutter pushed a commit that referenced this pull request Feb 8, 2024
Linux has removed strlcpy in favour of strscpy. This implements a
fallback implementation of strlcpy for this case.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes #15805
(cherry picked from commit 7466e09)
tonyhutter pushed a commit that referenced this pull request Feb 8, 2024
MAX_ORDER has been renamed to MAX_PAGE_ORDER. Rather than just
redefining it, instead define our own name and set it consistently from
the start.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes #15805
(cherry picked from commit 09e6724)
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
The kernel is now being compiled with -Wmissing-prototypes. Most of our
test stub functions had no prototype, and failed to compile. Since they
don't need to be visible anywhere else, just make them all static.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes openzfs#15805
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
blkdev_get_by_path() and blkdev_put() have been replaced by
bdev_open_by_path() and bdev_release(), which return a "handle" object
with the bdev object itself inside.

This adds detection for the new functions, and macros to handle the old
and new forms consistently.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes openzfs#15805
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
Linux has removed strlcpy in favour of strscpy. This implements a
fallback implementation of strlcpy for this case.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes openzfs#15805
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
MAX_ORDER has been renamed to MAX_PAGE_ORDER. Rather than just
redefining it, instead define our own name and set it consistently from
the start.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes openzfs#15805
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
The name inode_permission is now defined in the kernel. Rename ours to
test_permission, in line with most of our other tests.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes openzfs#15805
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
struct mnt_idmap no longer has a struct user_namespace within it. Work
around this by creating a temporary with the copy of the map we need
taken from the idmap.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Youzhong Yang <yyang@mathworks.com>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes openzfs#15805
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
The kernel is now being compiled with -Wmissing-prototypes. Most of our
test stub functions had no prototype, and failed to compile. Since they
don't need to be visible anywhere else, just make them all static.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes openzfs#15805
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
blkdev_get_by_path() and blkdev_put() have been replaced by
bdev_open_by_path() and bdev_release(), which return a "handle" object
with the bdev object itself inside.

This adds detection for the new functions, and macros to handle the old
and new forms consistently.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes openzfs#15805
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
Linux has removed strlcpy in favour of strscpy. This implements a
fallback implementation of strlcpy for this case.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes openzfs#15805
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
MAX_ORDER has been renamed to MAX_PAGE_ORDER. Rather than just
redefining it, instead define our own name and set it consistently from
the start.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes openzfs#15805
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
The name inode_permission is now defined in the kernel. Rename ours to
test_permission, in line with most of our other tests.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes openzfs#15805
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
struct mnt_idmap no longer has a struct user_namespace within it. Work
around this by creating a temporary with the copy of the map we need
taken from the idmap.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Youzhong Yang <yyang@mathworks.com>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes openzfs#15805
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
The kernel is now being compiled with -Wmissing-prototypes. Most of our
test stub functions had no prototype, and failed to compile. Since they
don't need to be visible anywhere else, just make them all static.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes openzfs#15805
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
blkdev_get_by_path() and blkdev_put() have been replaced by
bdev_open_by_path() and bdev_release(), which return a "handle" object
with the bdev object itself inside.

This adds detection for the new functions, and macros to handle the old
and new forms consistently.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes openzfs#15805
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
Linux has removed strlcpy in favour of strscpy. This implements a
fallback implementation of strlcpy for this case.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes openzfs#15805
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
MAX_ORDER has been renamed to MAX_PAGE_ORDER. Rather than just
redefining it, instead define our own name and set it consistently from
the start.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes openzfs#15805
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
The name inode_permission is now defined in the kernel. Rename ours to
test_permission, in line with most of our other tests.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes openzfs#15805
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Mar 13, 2024
struct mnt_idmap no longer has a struct user_namespace within it. Work
around this by creating a temporary with the copy of the map we need
taken from the idmap.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Youzhong Yang <yyang@mathworks.com>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes openzfs#15805
@tomchiverton
Copy link

This is closed, but the latest releases say they only support up to 6.7

Does ZFS 2.2.x support the 6.8 kernel or not ?

@ckane
Copy link
Contributor

ckane commented Apr 10, 2024

This is closed, but the latest releases say they only support up to 6.7

Does ZFS 2.2.x support the 6.8 kernel or not ?

@tomchiverton: looking at the commit log in the 2.2.4 staging branch (https://github.com/openzfs/zfs/tree/zfs-2.2.4-staging), it looks like 2.2.4 should work on Kernel 6.8 when it is released, I believe. I just cloned it and did a test build against Linux 6.8.4 and it seems to work fine.

@tomchiverton
Copy link

tomchiverton commented Apr 11, 2024 via email

@derekschrock
Copy link
Contributor

Is that likely to be soon, before all the Fedora (etc) users have issues again, like with 6.7? -- †øღ Sent from a super computer that fits in my pocket and is connected to the sum total of all human knowledge

On 10 April 2024 23:31:53 BST, Coleman Kane @.> wrote: > This is closed, but the latest releases say they only support up to 6.7 > > Does ZFS 2.2.x support the 6.8 kernel or not ? @tomchiverton: looking at the commit log in the 2.2.4 staging branch (https://github.com/openzfs/zfs/tree/zfs-2.2.4-staging), it looks like 2.2.4 should work on Kernel 6.8 when it is released, I believe. I just cloned it and did a test build against Linux 6.8.4 and it seems to work fine. -- Reply to this email directly or view it on GitHub: #15805 (comment) You are receiving this because you were mentioned. Message ID: @.>

I believe this is already and issue for Fedora 39 it has been 6.8.x for the past two weeks. I had to rpmrebuild zfs-dkms to edit the 6.7.999 max version.

@tonyhutter
Copy link
Contributor

@derekschrock I saw that with Fedora 39 as well. The upcoming 2.2.4 release will support the 6.8 kernel: #16107.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested) Type: Building Indicates an issue related to building binaries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build Issue - Kernel 6.8 rc 1 - Cheking whether fops->fallocate() exists... configure: error:
9 participants