apfs-dkms FTBS in Noble with the linux-6.17-hwe kernel

Bug #2133523 reported by John Cabaj
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-apfs-rw (Ubuntu)
Invalid
Undecided
Unassigned
Noble
Fix Committed
Undecided
Unassigned

Bug Description

[ Impact ]

DKMS make.log for linux-apfs-rw-0.3.2-0ubuntu6.1 for kernel 6.17.0-7-generic (x86_64)
Wed Nov 26 18:36:47 UTC 2025
make: Entering directory '/usr/src/linux-headers-6.17.0-7-generic'
make[1]: Entering directory '/var/lib/dkms/linux-apfs-rw/0.3.2-0ubuntu6.1/build'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc-13 (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
  You are using: gcc-13 (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
  CC [M] btree.o
  CC [M] compress.o
  CC [M] dir.o
  CC [M] extents.o
In file included from dir.c:8:
apfs.h:952:60: warning: ‘struct fileattr’ declared inside parameter list will not be visible outside of this definition or declaration
  952 | extern int apfs_fileattr_get(struct dentry *dentry, struct fileattr *fa);
      | ^~~~~~~~
apfs.h:953:85: warning: ‘struct fileattr’ declared inside parameter list will not be visible outside of this definition or declaration
  953 | extern int apfs_fileattr_set(struct mnt_idmap *idmap, struct dentry *dentry, struct fileattr *fa);
      | ^~~~~~~~
In file included from extents.c:8:
apfs.h:952:60: warning: ‘struct fileattr’ declared inside parameter list will not be visible outside of this definition or declaration
  952 | extern int apfs_fileattr_get(struct dentry *dentry, struct fileattr *fa);
      | ^~~~~~~~
apfs.h:953:85: warning: ‘struct fileattr’ declared inside parameter list will not be visible outside of this definition or declaration
  953 | extern int apfs_fileattr_set(struct mnt_idmap *idmap, struct dentry *dentry, struct fileattr *fa);
      | ^~~~~~~~
In file included from btree.c:8:
apfs.h:952:60: warning: ‘struct fileattr’ declared inside parameter list will not be visible outside of this definition or declaration
  952 | extern int apfs_fileattr_get(struct dentry *dentry, struct fileattr *fa);
      | ^~~~~~~~
apfs.h:953:85: warning: ‘struct fileattr’ declared inside parameter list will not be visible outside of this definition or declaration
  953 | extern int apfs_fileattr_set(struct mnt_idmap *idmap, struct dentry *dentry, struct fileattr *fa);
      | ^~~~~~~~
In file included from compress.c:10:
apfs.h:952:60: warning: ‘struct fileattr’ declared inside parameter list will not be visible outside of this definition or declaration
  952 | extern int apfs_fileattr_get(struct dentry *dentry, struct fileattr *fa);
      | ^~~~~~~~
apfs.h:953:85: warning: ‘struct fileattr’ declared inside parameter list will not be visible outside of this definition or declaration
  953 | extern int apfs_fileattr_set(struct mnt_idmap *idmap, struct dentry *dentry, struct fileattr *fa);
      | ^~~~~~~~
  CC [M] file.o
  CC [M] inode.o
  CC [M] key.o
  CC [M] libzbitmap.o
In file included from file.c:6:
apfs.h:952:60: warning: ‘struct fileattr’ declared inside parameter list will not be visible outside of this definition or declaration
  952 | extern int apfs_fileattr_get(struct dentry *dentry, struct fileattr *fa);
      | ^~~~~~~~
apfs.h:953:85: warning: ‘struct fileattr’ declared inside parameter list will not be visible outside of this definition or declaration
  953 | extern int apfs_fileattr_set(struct mnt_idmap *idmap, struct dentry *dentry, struct fileattr *fa);
      | ^~~~~~~~
  CC [M] lzfse/lzfse_decode.o
In file included from inode.c:11:
apfs.h:952:60: warning: ‘struct fileattr’ declared inside parameter list will not be visible outside of this definition or declaration
  952 | extern int apfs_fileattr_get(struct dentry *dentry, struct fileattr *fa);
      | ^~~~~~~~
apfs.h:953:85: warning: ‘struct fileattr’ declared inside parameter list will not be visible outside of this definition or declaration
  953 | extern int apfs_fileattr_set(struct mnt_idmap *idmap, struct dentry *dentry, struct fileattr *fa);
      | ^~~~~~~~
file.c: In function ‘apfs_page_mkwrite’:
file.c:57:9: error: implicit declaration of function ‘wait_for_stable_page’ [-Werror=implicit-function-declaration]
   57 | wait_for_stable_page(page);
      | ^~~~~~~~~~~~~~~~~~~~
file.c:63:14: error: implicit declaration of function ‘page_has_buffers’; did you mean ‘inode_has_buffers’? [-Werror=implicit-function-declaration]
   63 | if (!page_has_buffers(page))
      | ^~~~~~~~~~~~~~~~
      | inode_has_buffers
file.c:81:17: error: ‘struct page’ has no member named ‘index’
   81 | if (page->index == size >> PAGE_SHIFT)
      | ^~
file.c: At top level:
file.c:207:27: error: initialization of ‘int (*)(struct dentry *, struct file_kattr *)’ from incompatible pointer type ‘int (*)(struct dentry *, struct fileattr *)’ [-Werror=incompatible-pointer-types]
  207 | .fileattr_get = apfs_fileattr_get,
      | ^~~~~~~~~~~~~~~~~
file.c:207:27: note: (near initialization for ‘apfs_file_inode_operations.fileattr_get’)
file.c:208:27: error: initialization of ‘int (*)(struct mnt_idmap *, struct dentry *, struct file_kattr *)’ from incompatible pointer type ‘int (*)(struct mnt_idmap *, struct dentry *, struct fileattr *)’ [-Werror=incompatible-pointer-types]
  208 | .fileattr_set = apfs_fileattr_set,
      | ^~~~~~~~~~~~~~~~~
file.c:208:27: note: (near initialization for ‘apfs_file_inode_operations.fileattr_set’)
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-headers-6.17.0-7-generic/scripts/Makefile.build:287: file.o] Error 1
make[3]: *** Waiting for unfinished jobs....
inode.c: In function ‘__apfs_write_begin’:
inode.c:517:16: error: implicit declaration of function ‘grab_cache_page_write_begin’ [-Werror=implicit-function-declaration]
  517 | page = grab_cache_page_write_begin(mapping, index);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
inode.c:517:14: warning: assignment to ‘struct page *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  517 | page = grab_cache_page_write_begin(mapping, index);
      | ^
In file included from key.c:7:
apfs.h:952:60: warning: ‘struct fileattr’ declared inside parameter list will not be visible outside of this definition or declaration
  952 | extern int apfs_fileattr_get(struct dentry *dentry, struct fileattr *fa);
      | ^~~~~~~~
apfs.h:953:85: warning: ‘struct fileattr’ declared inside parameter list will not be visible outside of this definition or declaration
  953 | extern int apfs_fileattr_set(struct mnt_idmap *idmap, struct dentry *dentry, struct fileattr *fa);
      | ^~~~~~~~
inode.c:524:14: error: implicit declaration of function ‘page_has_buffers’; did you mean ‘inode_has_buffers’? [-Werror=implicit-function-declaration]
  524 | if (!page_has_buffers(page))
      | ^~~~~~~~~~~~~~~~
      | inode_has_buffers
inode.c: In function ‘__apfs_write_end’:
inode.c:657:33: error: passing argument 1 of ‘generic_write_end’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  657 | ret = generic_write_end(file, mapping, pos, len, copied, page_folio(page), fsdata);
      | ^~~~
      | |
      | struct file *
In file included from inode.c:7:
/usr/src/linux-headers-6.17.0-7-generic/include/linux/buffer_head.h:266:23: note: expected ‘const struct kiocb *’ but argument is of type ‘struct file *’
  266 | int generic_write_end(const struct kiocb *, struct address_space *,
      | ^~~~~~~~~~~~~~~~~~~~
inode.c: At top level:
inode.c:733:27: error: initialization of ‘int (*)(const struct kiocb *, struct address_space *, loff_t, unsigned int, struct folio **, void **)’ {aka ‘int (*)(const struct kiocb *, struct address_space *, long long int, unsigned int, struct folio **, void **)’} from incompatible pointer type ‘int (*)(struct file *, struct address_space *, loff_t, unsigned int, struct folio **, void **)’ {aka ‘int (*)(struct file *, struct address_space *, long long int, unsigned int, struct folio **, void **)’} [-Werror=incompatible-pointer-types]
  733 | .write_begin = apfs_write_begin,
      | ^~~~~~~~~~~~~~~~
inode.c:733:27: note: (near initialization for ‘apfs_aops.write_begin’)
inode.c:734:27: error: initialization of ‘int (*)(const struct kiocb *, struct address_space *, loff_t, unsigned int, unsigned int, struct folio *, void *)’ {aka ‘int (*)(const struct kiocb *, struct address_space *, long long int, unsigned int, unsigned int, struct folio *, void *)’} from incompatible pointer type ‘int (*)(struct file *, struct address_space *, loff_t, unsigned int, unsigned int, struct folio *, void *)’ {aka ‘int (*)(struct file *, struct address_space *, long long int, unsigned int, unsigned int, struct folio *, void *)’} [-Werror=incompatible-pointer-types]
  734 | .write_end = apfs_write_end,
      | ^~~~~~~~~~~~~~
inode.c:734:27: note: (near initialization for ‘apfs_aops.write_end’)
inode.c:2337:53: warning: ‘struct fileattr’ declared inside parameter list will not be visible outside of this definition or declaration
 2337 | int apfs_fileattr_get(struct dentry *dentry, struct fileattr *fa)
      | ^~~~~~~~
inode.c:2337:5: error: conflicting types for ‘apfs_fileattr_get’; have ‘int(struct dentry *, struct fileattr *)’
 2337 | int apfs_fileattr_get(struct dentry *dentry, struct fileattr *fa)
      | ^~~~~~~~~~~~~~~~~
apfs.h:952:12: note: previous declaration of ‘apfs_fileattr_get’ with type ‘int(struct dentry *, struct fileattr *)’
  952 | extern int apfs_fileattr_get(struct dentry *dentry, struct fileattr *fa);
      | ^~~~~~~~~~~~~~~~~
inode.c: In function ‘apfs_fileattr_get’:
inode.c:2341:29: error: passing argument 1 of ‘fileattr_fill_flags’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 2341 | fileattr_fill_flags(fa, flags);
      | ^~
      | |
      | struct fileattr *
In file included from inode.c:18:
/usr/src/linux-headers-6.17.0-7-generic/include/linux/fileattr.h:59:45: note: expected ‘struct file_kattr *’ but argument is of type ‘struct fileattr *’
   59 | void fileattr_fill_flags(struct file_kattr *fa, u32 flags);
      | ~~~~~~~~~~~~~~~~~~~^~
inode.c: At top level:
inode.c:2345:78: warning: ‘struct fileattr’ declared inside parameter list will not be visible outside of this definition or declaration
 2345 | int apfs_fileattr_set(struct mnt_idmap *idmap, struct dentry *dentry, struct fileattr *fa)
      | ^~~~~~~~
inode.c:2345:5: error: conflicting types for ‘apfs_fileattr_set’; have ‘int(struct mnt_idmap *, struct dentry *, struct fileattr *)’
 2345 | int apfs_fileattr_set(struct mnt_idmap *idmap, struct dentry *dentry, struct fileattr *fa)
      | ^~~~~~~~~~~~~~~~~
apfs.h:953:12: note: previous declaration of ‘apfs_fileattr_set’ with type ‘int(struct mnt_idmap *, struct dentry *, struct fileattr *)’
  953 | extern int apfs_fileattr_set(struct mnt_idmap *idmap, struct dentry *dentry, struct fileattr *fa);
      | ^~~~~~~~~~~~~~~~~
inode.c: In function ‘apfs_fileattr_set’:
inode.c:2355:15: error: invalid use of undefined type ‘struct fileattr’
 2355 | if (fa->flags & ~(FS_APPEND_FL | FS_IMMUTABLE_FL | FS_NODUMP_FL))
      | ^~
inode.c:2357:30: error: passing argument 1 of ‘fileattr_has_fsx’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 2357 | if (fileattr_has_fsx(fa))
      | ^~
      | |
      | struct fileattr *
/usr/src/linux-headers-6.17.0-7-generic/include/linux/fileattr.h:68:62: note: expected ‘const struct file_kattr *’ but argument is of type ‘struct fileattr *’
   68 | static inline bool fileattr_has_fsx(const struct file_kattr *fa)
      | ~~~~~~~~~~~~~~~~~~~~~~~~~^~
inode.c:2369:32: error: invalid use of undefined type ‘struct fileattr’
 2369 | apfs_setflags(inode, fa->flags);
      | ^~
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-headers-6.17.0-7-generic/scripts/Makefile.build:287: inode.o] Error 1
make[2]: *** [/usr/src/linux-headers-6.17.0-7-generic/Makefile:2016: .] Error 2
make[1]: *** [/usr/src/linux-headers-6.17.0-7-generic/Makefile:248: __sub-make] Error 2
make[1]: Leaving directory '/var/lib/dkms/linux-apfs-rw/0.3.2-0ubuntu6.1/build'
make: *** [Makefile:248: __sub-make] Error 2
make: Leaving directory '/usr/src/linux-headers-6.17.0-7-generic'

[ Test case ]

Install the latest linux-6.17 kernel on Noble:

$ sudo add-apt-repository ppa:canonical-kernel-team/ppa3
$ sudo apt install linux-generic-hwe-24.04-edge

Install apfs-dkms:

$ sudo apt install apfs-dkms

Package built and installed successfully.

Load the module:

$ sudo modprobe apfs

Module loaded with no issues.

Verify the filesystem has been registered properly:

$ grep apfs /proc/filesystems

apfs was listed as available fileystem.

The same procedure can be repeated on linux-6.8 to test for possible regressions.

[ Fix ]

Apply upstream patches to properly support the new linux 6.17 ABI, namely the following:
     - debian/patches/0009-Annotate-jump-table-in-lzvn-decompression-code.patch
     - debian/patches/0010-Handle-page-functions-newly-removed-in-6.15.patch
     - debian/patches/0011-Fix-the-returned-type-of-mkdir-for-6.15.patch
     - debian/patches/0012-Dont-reference-page-index-in-6.16.patch
     - debian/patches/0013-Rename-struct-fileattr-to-struct-file_kattr.patch
     - debian/patches/0014-Fix-the-pafs_write_begin-end-type-for-6.17.patch
     - debian/patches/0015-Set-dentry-operations-in-the-new-way.patch

[ Regression potential ]

We may experience regressions in systems that are using the Apple file system module (apfs), especially with kernels >= 6.8 kernel.

Revision history for this message
John Cabaj (john-cabaj) wrote :

0.3.2-0ubuntu6.1 -> 0.3.2-0ubuntu6.2 debdiff

Revision history for this message
John Cabaj (john-cabaj) wrote :
description: updated
Revision history for this message
Massimiliano Pellizzer (mpellizzer) wrote :

Sponsored, thanks

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

6.14 is the current hwe kernel and would need to be tested as well

Changed in linux-apfs-rw (Ubuntu):
status: New → Invalid
Changed in linux-apfs-rw (Ubuntu Noble):
status: New → Fix Committed
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello John, or anyone else affected,

Accepted linux-apfs-rw into noble-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/linux-apfs-rw/0.3.2-0ubuntu6.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-noble to verification-done-noble. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-noble. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.