toby63 / shiftfs-dkms

shiftfs kernel module via dkms
GNU General Public License v2.0
38 stars 10 forks source link

is_idmapped_mnt throwing error on compilation #25

Open JoeMattie opened 1 year ago

JoeMattie commented 1 year ago

Seeing this crop up since the update a few days ago:

Tue Feb 21 22:06:59 UTC 2023
make[1]: Entering directory '/var/lib/dkms/shiftfs/k516/build'
make -C /lib/modules/5.15.0-1017-aws/build M="$(pwd)" EXTRA_CFLAGS="-DSHIFTFS_MAGIC=0x6a656a62" modules
make[2]: Entering directory '/usr/src/linux-headers-5.15.0-1017-aws'
  CC [M]  /var/lib/dkms/shiftfs/k516/build/shiftfs.o
/var/lib/dkms/shiftfs/k516/build/shiftfs.c: In function ‘shiftfs_fill_super’:
/var/lib/dkms/shiftfs/k516/build/shiftfs.c:2022:6: error: implicit declaration of function ‘is_idmapped_mnt’ [-Werror=implicit-function-declaration]
 2022 |  if (is_idmapped_mnt(path.mnt)) {
      |      ^~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:297: /var/lib/dkms/shiftfs/k516/build/shiftfs.o] Error 1
make[2]: *** [Makefile:1881: /var/lib/dkms/shiftfs/k516/build] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-5.15.0-1017-aws'
make[1]: *** [Makefile:15: default] Error 2
make[1]: Leaving directory '/var/lib/dkms/shiftfs/k516/build'

Comment by @toby63:

Workaround is to use an older commit for now. Run the following in your shiftfs folder, usually named shiftfs-k516:

git checkout 941cb2dbf892c5838355c74078e571d490936827 - this will use the 4th last commit, which still worked. Then run the build with make -f Makefile.dkms again.

toby63 commented 1 year ago

@mihalicyn @brauner This is about the following commit to shiftfs: https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy/commit/fs/shiftfs.c?h=master-next&id=16fdcaeef4aedf3a0281d79c0978e3aec47c62a6

I assume you declared the function _‘is_idmappedmnt’ somewhere else in the ubuntu kernel, can this be included here?

Edit: I found the commit: https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy/commit/?h=master-next&id=03dfc6a8ca9206357f6d8e02ff2fe5321baca348 It mentions an upstream commit...

Update2: Build on 6.1 kernel works flawless, so I assume a kernel version problem, if a kernel does not include the mentioned commit.


@JoeMattie Interesting. Sry for the problem, I should have tested the new release beforehand, I assumed that everything was working correctly, but other users seem to have used regular Ubuntu kernels....

In case you did not know, you could try the following ways to "workaround" the problem:

toby63 commented 1 year ago

@JoeMattie As my build on a 6.1 kernel is working, I assume it could be a problem with the kernel version :thinking:.

Your kernel needs to include commit bb49e9e730c2906a958eee273a7819f401543d6c, which is described here: https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy/commit/?h=master-next&id=03dfc6a8ca9206357f6d8e02ff2fe5321baca348

I will test a 5.15 kernel tomorrow.

JoeMattie commented 1 year ago

Thank you for the quick reply! We worked around the issue temporarily with git checkout 941cb2dbf892c5838355c74078e571d490936827

toby63 commented 1 year ago

So I checked 5.15 kernels (5.15.94) and everything works normal.

I guess the problem is with specific kernels like yours, that somehow don't have the mentioned commit or that maybe deactivated the functionality.

I assume you use this kernel from Ubuntu: https://packages.ubuntu.com/jammy/linux-image-5.15.0-1017-aws ? In that case, I would encourage you to contact the Ubuntu team about this (https://launchpad.net/ubuntu/+source/linux-signed-aws/+bugs) and see what they got to say.

mihalicyn commented 1 year ago

Guys, do you need any help from my side?

mihalicyn commented 1 year ago

I guess the problem is with specific kernels like yours, that somehow don't have the mentioned commit or that maybe deactivated the functionality.

It looks like they haven't ported idmapped mounts support to this kernel version yet.

toby63 commented 1 year ago

I guess the problem is with specific kernels like yours, that somehow don't have the mentioned commit or that maybe deactivated the functionality.

It looks like they haven't ported idmapped mounts support to this kernel version yet.

Thx for confirming.