shiftfs-dkms icon indicating copy to clipboard operation
shiftfs-dkms copied to clipboard

is_idmapped_mnt throwing error on compilation

Open JoeMattie opened this issue 2 years ago • 7 comments

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.

JoeMattie avatar Feb 21 '23 22:02 JoeMattie

@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_idmapped_mnt’ 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:

  • either download and replace the shiftfs.c file in the shiftfs folder, usually named shiftfs-k516 : Run: wget 'https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy/plain/fs/shiftfs.c?h=master-next&id=b1210ccf924ede51e4d8a1f451a7ffdd8e9ea03d' and: mv 'shiftfs.c?h=master-next&id=b1210ccf924ede51e4d8a1f451a7ffdd8e9ea03d' shiftfs.c (this will download and rename the new shiftfs.c file) and then run the build again.
  • or try to use git revert: Try to run git revert 879243299831e054443bb92dd20ab5c2ab5c6238 in the shiftfs folder, usually named shiftfs-k516 and then run the build again.

toby63 avatar Feb 21 '23 23:02 toby63

@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.

toby63 avatar Feb 21 '23 23:02 toby63

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

JoeMattie avatar Feb 22 '23 00:02 JoeMattie

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.

toby63 avatar Feb 23 '23 09:02 toby63

Guys, do you need any help from my side?

mihalicyn avatar Feb 23 '23 09:02 mihalicyn

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.

mihalicyn avatar Feb 23 '23 09:02 mihalicyn

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.

toby63 avatar Feb 23 '23 10:02 toby63