[2.3] Linux 6.18 compat#18038
Conversation
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <robn@despairlabs.com>
ida_simple_get() and ida_simple_remove() are removed in 6.18. However, since 4.19 they have been simple wrappers around ida_alloc() and ida_free(), so we can just use those directly. Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <robn@despairlabs.com>
Linux 6.18 removed write_cache_pages() without a usable replacement. Here we implement a minimal zpl_write_cache_pages() that find the dirty pages within the mapping, gets them into the expected state and hands them off to zfs_putpage(), which handles the rest. Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <robn@despairlabs.com>
The namespace type has moved from the namespace ops struct to the "common" base namespace struct. Detect this and define a macro that does the right thing for both versions. Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <robn@despairlabs.com>
Linux 6.18 has conflicting prototypes for various sha256_* and sha512_* functions, which we get through a very long include chain. That's tough to fix right now; easier is just to rename our internal functions. Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <robn@despairlabs.com>
Linux switched from -std=gnu89 to -std=gnu11 in 5.18 (torvalds/linux@e8c07082a810f). We've always overridden that with gnu99 because we use some newer features. More recent kernels are using C11 features in headers that we include. GCC generally doesn't seem to care, but more recent versions of Clang seem to be enforcing our gnu99 override more strictly, which breaks the build in some configurations. Just bumping our "override" to match the kernel seems to be the easiest workaround. It's an effective no-op since 5.18, while still allowing us to build on older kernels. Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <robn@despairlabs.com>
Using strlen() in an static array declaration is a GCC extension. Clang calls it "gnu-folding-constant" and warns about it, which breaks the build. If it were widespread we could just turn off the warning, but since there's only one case, lets just change the array to an explicit size. Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <robn@despairlabs.com>
6.18 changes kmap_atomic() to take a const pointer. This is no problem for the places we use it, but Clang fails the test due to a warning about being unable to guarantee that uninitialised data will definitely not change. Easily solved by forcibly initialising it. Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <robn@despairlabs.com>
|
I get an error when applying this patch with the zfs-dkms PKGBUILD: This PR works if I remove the part related to |
|
Please leave the commit messages unaltered when backporting. I see: [master] bfd137d92 config/kmap_atomic: initialise test data
[linux-6.18-compat-2.3] 77da44de6 config/kmap_atomic: initialise test data
--- /tmp/diff-master 2025-12-15 17:31:01.043026912 -0800
+++ /tmp/diff-linux-6.18-compat-2.3 2025-12-15 17:31:01.043026912 -0800
@@ -10,10 +10,7 @@
not change. Easily solved by forcibly initialising it.
Sponsored-by: https://despairlabs.com/sponsor/
- Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
- Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
- Closes #17954
diff --git a/config/kernel-kmap-atomic-args.m4 b/config/kernel-kmap-atomic-args.m4[master] b7e00c739 zvol_id: make array length properly known at compile time
[linux-6.18-compat-2.3] 86200a21f zvol_id: make array length properly known at compile time
--- /tmp/diff-master 2025-12-15 17:31:01.184026906 -0800
+++ /tmp/diff-linux-6.18-compat-2.3 2025-12-15 17:31:01.184026906 -0800
@@ -11,10 +11,7 @@
size.
Sponsored-by: https://despairlabs.com/sponsor/
- Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
- Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
- Closes #17954
diff --git a/udev/zvol_id.c b/udev/zvol_id.c[master] c631f5e6c Linux: bump -std to gnu11
[linux-6.18-compat-2.3] 9888d8a24 Linux: bump -std to gnu11
--- /tmp/diff-master 2025-12-15 17:31:01.325026899 -0800
+++ /tmp/diff-linux-6.18-compat-2.3 2025-12-15 17:31:01.326026899 -0800
@@ -18,10 +18,7 @@
to build on older kernels.
Sponsored-by: https://despairlabs.com/sponsor/
- Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
- Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
- Closes #17954I also see authors being changed, Co-authored lines being changed, and added Signed-off-by lines: [master] ccf5a8a6f linux: use sys/stat.h instead of linux/stat.h
[linux-6.18-compat-2.3] bbbf438d6 linux: use sys/stat.h instead of linux/stat.h
--- /tmp/diff-master 2025-12-15 17:31:02.335026850 -0800
+++ /tmp/diff-linux-6.18-compat-2.3 2025-12-15 17:31:02.335026850 -0800
@@ -1,6 +1,6 @@
-Author: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
-Date: Wed Aug 27 17:42:32 2025 -0400
+Author: Alexander Moch <github@alexanderjulian.de>
+Date: Tue Dec 9 19:58:45 2025 +0000
linux: use sys/stat.h instead of linux/stat.h
@@ -15,8 +15,12 @@
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Tested-By: Achill Gilgenast <achill@achill.org>
- Signed-off-by: classabbyamp <dev@placeviolette.net>
+
Closes #17675
+
+ Signed-off-by: classabbyamp <dev@placeviolette.net>
+ Signed-off-by: Alexander Moch <mail@alexmoch.com>
+ Co-authored-by: classabbyamp <5366828+classabbyamp@users.noreply.github.com>[master] 9acedbace config: Fix LLVM-21 -Wuninitialized-const-pointer warning
[linux-6.18-compat-2.3] 2d9ba1e3c config: Fix LLVM-21 -Wuninitialized-const-pointer warning (#17997)
--- /tmp/diff-master 2025-12-15 17:31:02.477026844 -0800
+++ /tmp/diff-linux-6.18-compat-2.3 2025-12-15 17:31:02.477026844 -0800
@@ -1,8 +1,8 @@
-Author: Brian Behlendorf <behlendorf1@llnl.gov>
-Date: Tue Sep 2 09:34:08 2025 -0700
+Author: Alexander Moch <github@alexanderjulian.de>
+Date: Wed Dec 3 19:30:55 2025 +0000
- config: Fix LLVM-21 -Wuninitialized-const-pointer warning
+ config: Fix LLVM-21 -Wuninitialized-const-pointer warning (#17997)
LLVM-21 enables -Wuninitialized-const-pointer which results in the
following compiler warning and the bdev_file_open_by_path() interface
@@ -15,9 +15,13 @@
argument here [-Werror,-Wuninitialized-const-pointer]
Reviewed-by: Rob Norris <robn@despairlabs.com>
- Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+
Closes #17682
Closes #17684
+
+ Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+ Signed-off-by: Alexander Moch <mail@alexmoch.com>
+ Co-authored-by: Brian Behlendorf <behlendorf1@llnl.gov> |
Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Rob Norris <robn@despairlabs.com>
|
@behlendorf META bumped. @tonyhutter I usually treat them as brand-new commits, because some are actually different in small ways because the code they're patching is different, but more importantly, the listed reviewers have not signed off on them in this context, and I do not wish to speak for them. I can do something different, but please do let me know what the goal is because it's different to what I've done before and I want to make sure I'm bringing over the bits that are important to you. (The change in authors and co-authors is nothing to do with me; those came from #17997). |
@behlendorf : you are right. I was using the standard PKGBUILD with If I do a |
|
@robn you actually bring up a good point, in that we have no documentation how we want backports to be done! I just opened a PR here to update the docs with backport instructions: openzfs/openzfs-docs#592. Please commit in that PR with what you think of the policy. |
|
@tonyhutter : Sorry for the silly question but I can't find the tracker for 2.3.6 release. Upstream has EOL'ed 6.17.xx and its that time of the upgrade cycle again. |
Motivation and Context
Adding 6.18.x kernel support to 2.3.x. This is the LTS kernel for next year, so we should try to work with it.
Closes #18026.
Description
Cherry-picks commits from #17842 with appropriate adjustments.
Changes to
module/os/linux/zvol_os.care a little different because #17625 etc not backported.Did not pick fe8b50f because we do not use
generic_drop_inode()/generic_delete_inode()(#17746 not backported).Also including commits from #17954 to allow compilation with recent Clang.
How Has This Been Tested?
Compile checked only against kernels: 6.18.0 6.15.9 6.12.41 6.8.12 6.1.147 5.10.240 4.19.325
Types of changes
Checklist:
Signed-off-by.