apfs-dkms FTBS with linux 6.5 on jammy

Bug #2039521 reported by Andrea Righi
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
linux-apfs-rw (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Fix Committed
Undecided
Unassigned

Bug Description

[Impact]

/var/lib/dkms/linux-apfs-rw/0+git20220214+ds-2ubuntu2~22.04.2/build/file.c:143:27: error: initialization of ‘int (*)(struct mnt_idmap *, const struct path *, struct kstat *, u32, unsigned int)’ {aka ‘int (*)(struct mnt_idmap *, const struct path *, struct kstat *, unsigned int, unsigned int)’} from incompatible pointer type ‘int (*)(struct user_namespace *, const struct path *, struct kstat *, u32, unsigned int)’ {aka ‘int (*)(struct user_namespace *, const struct path *, struct kstat *, unsigned int, unsigned int)’} [-Werror=incompatible-pointer-types]
  143 | .getattr = apfs_getattr,
      | ^~~~~~~~~~~~
/var/lib/dkms/linux-apfs-rw/0+git20220214+ds-2ubuntu2~22.04.2/build/file.c:143:27: note: (near initialization for ‘apfs_file_inode_operations.getattr’)
/var/lib/dkms/linux-apfs-rw/0+git20220214+ds-2ubuntu2~22.04.2/build/file.c:145:27: error: initialization of ‘int (*)(struct mnt_idmap *, struct dentry *, struct iattr *)’ from incompatible pointer type ‘int (*)(struct user_namespace *, struct dentry *, struct iattr *)’ [-Werror=incompatible-pointer-types]
  145 | .setattr = apfs_setattr,
      | ^~~~~~~~~~~~

[Test case]

 $ sudo apt install apfs-dkms

The fix has been tested running the above command both with the stock 5.15 kernel and the new 6.5 kernel:

== 6.5 kernel ==

05:40 ubuntu@jammy$ sudo dpkg -i apfs-dkms_0+git20220214+ds-2ubuntu2~22.04.3_all.deb
Selecting previously unselected package apfs-dkms.
(Reading database ... 115626 files and directories currently installed.)
Preparing to unpack apfs-dkms_0+git20220214+ds-2ubuntu2~22.04.3_all.deb ...
Unpacking apfs-dkms (0+git20220214+ds-2ubuntu2~22.04.3) ...
Setting up apfs-dkms (0+git20220214+ds-2ubuntu2~22.04.3) ...
Loading new linux-apfs-rw-0+git20220214+ds-2ubuntu2~22.04.3 DKMS files...
Building for 6.5.0-9-generic
Building initial module for 6.5.0-9-generic
EFI variables are not supported on this system
/sys/firmware/efi/efivars not found, aborting.
Done.

apfs.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.5.0-9-generic/updates/dkms/

depmod...
6.5.0-9-generic ~
05:40 ubuntu@jammy$ sudo modprobe apfs
6.5.0-9-generic ~
05:40 ubuntu@jammy$ grep apfs /proc/filesystems
 apfs
6.5.0-9-generic ~

== 5.15 kernel ==

05:42 ubuntu@jammy$ sudo dpkg -i apfs-dkms_0+git20220214+ds-2ubuntu2~22.04.3_all.deb
Selecting previously unselected package apfs-dkms.
(Reading database ... 98084 files and directories currently installed.)
Preparing to unpack apfs-dkms_0+git20220214+ds-2ubuntu2~22.04.3_all.deb ...
Unpacking apfs-dkms (0+git20220214+ds-2ubuntu2~22.04.3) ...
Setting up apfs-dkms (0+git20220214+ds-2ubuntu2~22.04.3) ...
Loading new linux-apfs-rw-0+git20220214+ds-2ubuntu2~22.04.3 DKMS files...
Building for 5.15.0-88-generic
Building initial module for 5.15.0-88-generic
EFI variables are not supported on this system
/sys/firmware/efi/efivars not found, aborting.
Done.

apfs.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.15.0-88-generic/updates/dkms/

depmod...
5.15.0-88-generic ~
05:42 ubuntu@jammy$ sudo modprobe apfs
5.15.0-88-generic ~
05:42 ubuntu@jammy$ grep apfs /proc/filesystems
 apfs

[Fix]

Backport and apply apfs upstream patches to support the new 6.5 kernel ABI.

[Regression potential]

We may experience failures or crashes in systems that are using the apfs filesystem, especially with the new 6.5 kernel. We don't expect to see regressions in older kernels, since the additional patches contain code that is only compiled with the 6.5 kernel (via ifdef's).

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: apfs-dkms 0+git20220214+ds-2ubuntu2~22.04.2
ProcVersionSignature: User Name 6.5.0-9.9~22.04.2-generic 6.5.3
Uname: Linux 6.5.0-9-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckResult: unknown
CloudArchitecture: x86_64
CloudID: nocloud
CloudName: unknown
CloudPlatform: nocloud
CloudSubPlatform: config-disk (/dev/vdb)
Date: Tue Oct 17 05:28:28 2023
PackageArchitecture: all
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=C.UTF-8
 SHELL=/bin/bash
SourcePackage: linux-apfs-rw
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Andrea Righi (arighi) wrote :
Revision history for this message
Andrea Righi (arighi) wrote :
description: updated
tags: added: patch
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Andrea, or anyone else affected,

Accepted linux-apfs-rw into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/linux-apfs-rw/0+git20220214+ds-2ubuntu2~22.04.3 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-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. 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.

Changed in linux-apfs-rw (Ubuntu Jammy):
status: New → Fix Committed
Changed in linux-apfs-rw (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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