-
Notifications
You must be signed in to change notification settings - Fork 1.2k
mount from 2.39.1 fails to process fstab on older kernels #2409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Could you cherry-pick the fix to the 2.39 branch? Thanks. (Ideally with the other statx fixes as well, if possible?) |
gentoo-bot
pushed a commit
to gentoo/gentoo
that referenced
this issue
Aug 3, 2023
Ended up backporting the wall fix as we need the mount w/ no statx fix anyway. Bug: https://bugs.gentoo.org/911336 Bug: util-linux/util-linux#2409 Signed-off-by: Sam James <sam@gentoo.org>
karelzak
pushed a commit
to karelzak/util-linux-work
that referenced
this issue
Aug 16, 2023
If the systemcall is not available ENOSYS is returned. Under glibc the statx implementation also has its own fallback logic. As AT_STATX_DONT_SYNC can't be implemented correctly in that fallback logic the wrapper will return EINVAL in case the emulation is needed and AT_STATX_DONT_SYNC is set. So also use our own fallback in that case. Fixes: util-linux#2409 Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As of util-linux-2.39 mount switched to statx() call on fstab, which ist not available on older kernels (prior to 4.11, I think).
Problem occured on 4.9 which EOL'd in January, can't tell if the problem exists on 4.4 SLTS, 4.14 however does provide the syscall and things work as expected.
Snippet from strace:
14040 prctl(PR_GET_DUMPABLE) = 1 (SUID_DUMP_USER)
14040 statx(AT_FDCWD, "/etc/fstab", AT_STATX_DONT_SYNC|AT_NO_AUTOMOUNT, STATX_TYPE|STATX_MODE|STATX_INO, 0x7ffc3697ab90) = -1 ENOSYS (Function not implemented)
14040 getuid() = 0
and this should (hopefully) be the corrsponding call from ltrace:
14035 mnt_context_get_target(0x55a3485e7550, 0x7f116bdd5548, 0, 0) = 0x55a3485e7960
Further Info:
mount --version
mount from util-linux 2.39.1 (libmount 2.39.1: btrfs, namespaces, idmapping, assert, debug)
uname -a
Linux odin 4.9.336 #2 SMP Sat Dec 17 22:52:49 CET 2022 x86_64 Intel(R) Atom(TM) CPU C2558 @ 2.40GHz GenuineIntel GNU/Linux
LIBMOUNT_DEBUG=all mount /usr/src
3275: libmount: INIT: library debug mask: 0xffffff
3275: libmount: INIT: library version: 2.39.1
3275: libmount: INIT: feature: btrfs
3275: libmount: INIT: feature: namespaces
3275: libmount: INIT: feature: idmapping
3275: libmount: INIT: feature: assert
3275: libmount: INIT: feature: debug
Available "LIBMOUNT_DEBUG=[,...]|" debug masks:
all [0xffffff] : info about all subsystems
cache [0x000004] : paths and tags cache
cxt [0x000200] : library context (handler)
diff [0x000400] : mountinfo changes tracking
fs [0x000040] : FS abstraction
help [0x000001] : this help
hook [0x008000] : hooks functionality
locks [0x000010] : mtab and utab locking
loop [0x002000] : loop devices routines
options [0x000008] : mount options parsing
optlist [0x010000] : mount options container
tab [0x000020] : fstab, mtab, mountinfo routines
update [0x000080] : mtab, utab updates
utils [0x000100] : misc library utils
monitor [0x000800] : mount tables monitor
btrfs [0x001000] : btrfs specific routines
verity [0x004000] : verity specific routines
3275: libmount: CXT: [0x563947544570]: ----> allocate
3275: libmount: OPTLIST: [0x5639475446d0]: alloc
3275: libmount: OPTLIST: [0x5639475446d0]: registr map 0x7fdbb67515e0
3275: libmount: OPTLIST: [0x5639475446d0]: registr map 0x7fdbb67513e0
3275: libmount: FS: [0x563947544890]: alloc
3275: libmount: CXT: [0x563947544570]: mount: preparing
3275: libmount: CXT: [0x563947544570]: use default optsmode
3275: libmount: OPTLIST: [0x5639475446d0]: return flags 0x00000000 [map=0x7fdbb67515e0]
3275: libmount: CXT: [0x563947544570]: OPTSMODE (file-part): force=0, fstab=1, mtab=1
3275: libmount: CXT: [0x563947544570]: trying to apply fstab (src=(null), target=/usr/src)
3275: libmount: TAB: [0x563947544980]: alloc
3275: libmount: CACHE: [0x5639475449f0]: alloc
3275: libmount: CXT: [0x563947544570]: failed to find entry in fstab/mountinfo [rc=-22]: Invalid argument
3275: libmount: CXT: [0x563947544570]: mount: preparing failed
3275: libmount: CXT: [0x563947544570]: mnt_context_mount() done [rc=-5000]
3275: libmount: OPTLIST: [0x5639475446d0]: return flags 0x00000000 [map=0x7fdbb67515e0]
3275: libmount: OPTLIST: [0x5639475446d0]: return flags 0x00000000 [map=0x7fdbb67513e0]
3275: libmount: CXT: [0x563947544570]: excode: rc=1 message="can't find in /etc/fstab"
mount: /usr/src: can't find in /etc/fstab.
3275: libmount: CXT: [0x563947544570]: <---- reset [status=0] ---->
3275: libmount: FS: [0x563947544890]: free [refcount=0]
3275: libmount: TAB: [0x563947544980]: reset
3275: libmount: TAB: [0x563947544980]: free [refcount=0]
3275: libmount: CACHE: [0x5639475449f0]: free [refcount=0]
3275: libmount: CXT: [0x563947544570]: Setting (null) as target namespace
3275: libmount: CXT: [0x563947544570]: free
The text was updated successfully, but these errors were encountered: