Closed daniejstriata closed 1 year ago
Do you know what version of the kernel and glibc you're running with? I'm guessing it's old enough that statx just isn't supported? Which I guess we could look at adding a slower non-statx path if really needed. Thanks.
statx() was added to Linux in kernel 4.11; library support was added in glibc 2.28.
@mikesart Thanks for looking, the Centos 7 kernel is still 3.10 and glibc on 2.17. I'm starting to phasing out my Centos 7 hosts this year as it is getting EOLed next year. Closing this off.
Would it be possible for the utility to detect when the kernel doesn't support the statx or whatever it requires, and print out an appropriate error?
I tried running it on 2.6.32-042stab120.18
. I had to remove -Wimplicit-fallthrough=2
from the Makefile and compile with make CXX=g++-9
on Ubuntu 16. The build was successful, but when running it, it reports zero inotify handles. I am certain I do have inotify handles open, because lsof -p
lists them. strace
shows events are handled when the watched files change, and the applications using inotify watches react correctly to file changes.
The problem is that inotify-info output is wrong (shows zero handles):
$ _release/inotify-info -vv
0 ignore_dirs:
------------------------------------------------------------------------------
INotify Limits:
max_queued_events 16,384
max_user_instances 128
max_user_watches 524,288
------------------------------------------------------------------------------
Pid Uid App Watches Instances
------------------------------------------------------------------------------
Total inotify Watches: 0
Total inotify Instances: 0
------------------------------------------------------------------------------
I appreciate that statx
is required, but I, and other users in the future will waste time attempting to use this utility on old systems.
Legacy systems are not going away, and it's good form for new-fangled software like this to fail correctly with 'unsupported kernel' or such message. "Total inotify Watches: 0" is a lie.
Thank you.
There is this bit of code in inotify-info.cpp:
// statx() was added to Linux in kernel 4.11; library support was added in glibc 2.28.
#if defined( __linux__ ) && ( ( __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 28 ) || ( __GLIBC__ > 2 ) )
Can you change this to be this:
// statx() was added to Linux in kernel 4.11; library support was added in glibc 2.28.
#if 0
And rebuild the app and see if it works?
@mikesart, I tried the change you suggested and does not work. The behaviour is unchanged. My system used libc6 2.23-0ubuntu11.3, so the conditional evaluates as false with or without this change.
I looked a bit into the situation, and submitted #19, which implements backwards compatibility to kernel 2.6.32. I have not tested earlier kernels. The stat functions are not called at all on old kernels, because individual watches cannot be resolved; the fdinfo files in /proc do not include the necessary device info (the inotify wd:...
line)
Hi,
When running
make
I get failures. I've also tried compiling the code against the Developer Toolset 7..10.When using g++ (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
When using Developer Toolset 9 - g++ (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2)
It compiled successfully on Rocky 8.