RHEL 8 AFT is crashed in opencode
Short description
RHEL 8 uses Linux kernel 4.18 which doesn't support STATX_MNT_ID. The guard failed and crashed the AFT binary.
What happened?
The AFT binary crashes and all AFT tools failed in OpenCode. The plugin version v0.58.2 works. The log pasted in the log section.
Because STATX_MNT_ID mask bit + stx_mnt_id field is only supported since Linux 5.8, the Linux 4.11-5.7 has statx implementation but still cannot pass the guard. Please consider using name_to_handle_at for the fallback of stx_mnt_id.
Diagnostics
Plugin version
0.65.0
AFT binary version
0.65.0
Platform
linux x64 (kernel version: 4.18)
Log output (optional)
The aft-plugin.log (I substitute the username with $USER, and my AFT_STORAGE_DIR is /dev/shm/$USER/aft-storage):
INFO [aft-plugin] [aft] cannot acquire storage lease for /dev/shm/$USER/aft-storage: kernel cannot verify repair mount boundary
INFO [aft-plugin] Process exited: code=1, signal=null
ERROR [aft-plugin] Binary crashed (restarts: 3).
Thanks for the precise report, and for pinning down the kernel version.
You're right about the cause. At startup AFT checks that its storage folder sits on one mount, and it reads the mount id with statx(STATX_MNT_ID). That flag only exists from Linux 5.8. On 4.18 the kernel answers statx without it, so AFT refuses the storage folder and exits, which is the crash you see.
We're adding a fallback. When statx doesn't return the mount id, AFT reads the same id from /proc/self/fdinfo/<fd>, which kernels have provided since 3.15. It's the same mount id statx reports, so the safety check keeps its strength. We chose it over name_to_handle_at because that call fails on filesystems without export support, while fdinfo works on all of them.
The fix will be in the next release, and I'll post here when it ships.