Fix enabling of fanotify/fsnotify.#183
Conversation
|
Thanks very much for the contribution @jankratochvil ! This fails CI, it's not immediately obvious to be why, would need to be fixed before merged, this script: re-creates what the CI does. |
|
Tests fail rapidly, might be worth poking @amir73il |
|
I am missing context. |
|
I thought so, I haven't had a moment to look at this in detail yet. |
|
Since the initial commit 0971a97 without an explicit |
|
rerunnning the checks |
|
I think the existing errors are false positives only. |
|
@jankratochvil what do you mean by "fanotify does not work in containers"?
I have a vague memory about @ericcurtin running the tests manually with sudo before merging, because the CI does not run them as root, but I may be wrong. In any case, the tests fsnotifywait --fanotify (without --filesystem) should be able to run and pass inside or outside of containers. I have a pretty simple patch to allow fanotify --filesystem watch inside rootless containers (amir73il/linux@2e6f12e) but that support is not upstream and nobody asked me to expedite it. If rootless fanotify --filesystem support would be merged, the test would have to change to mount a tmpfs |
| apk add build-base alpine-sdk autoconf automake libtool bash coreutils clang \ | ||
| clang-extra-tools lld linux-headers curl git zip gcompat | ||
| elif command -v dnf; then | ||
| $pre dnf install -y gcc-c++ autoconf automake doxygen make libtool clang curl git unzip |
There was a problem hiding this comment.
Thanks for enabling a Fedora build, meant to get around to this.
|
In case you guys haven't noticed, I ported this codebase to C++ also, but I plan on using a restricted set of C++ the "-nodefaultlibs -lc -fno-exceptions" kind so we don't gain any extra runtime dependencies. |
|
I am running everything as root (in KVM) and I get: It has been run by It has been tested on:
So I do not know what else to blame than kernel. |
|
Ah it's overlayfs ? This needs more code that is not upstream https://github.com/amir73il/linux/commits/ovl_encode_fid Can you run the test on a directory that is shared from the host and not on overlayfs? Or mount a filesystem for running the test. |
Yes.
That is what happens by default when using containers. Maybe it could also run a test in non-containerized mode to have better testing coverage? Personally I just wanted to enable the fanotify functionality when you did already implement it. I have tried to modify |
|
Are there container filesystems we can use that supports this other than overlayfs? If no, we can run outside containers, just like to do everything in containers to be able to easily migrate CI or run locally etc. |
There are several way to fix this. I will see if we can generalize the test later |
amir73il
left a comment
There was a problem hiding this comment.
I think the minimum fix needed for enable fanotify is to add mkfs -F flag and to test root user as requirement for --filesystem watch test
| ../../src/fsnotifywait --fanotify $* 2>&1 | grep -q 'No files specified' | ||
| if [ -z "$(grep 'kthreadd' /proc/2/status 2>/dev/null)" ]; then | ||
| # FIXME: fanotify is broken in containers | ||
| # https://stackoverflow.com/a/72136877/2995591 |
There was a problem hiding this comment.
Please be accurate. It is not working on overlayfs.
It would be pretty easy to fix by using tmpfs but I can do that later.
@ericcurtin I created an improved version of fanotify_supported(). please see https://github.com/amir73il/inotify-tools/commits/fsnotify. This branch includes the fanotify build fixes by @jankratochvil, but not his Fedora fixes which are unrelated to fanotify |
|
@amir73il cool, feel free to open a PR for that, that one looks looks good to me. This one does too! Merging... |
|
Kudos, SonarCloud Quality Gate passed! |








It just never could get enabled.