Merge the fs_error branch#410
Merged
Merged
Conversation
FAN_FS_ERROR monitoring opens a second fanotify notification group and closes it during daemon shutdown. The blocked-task trace from the hang is in the fanotify group close path, so deployments need a build-time way to remove that newer descriptor while testing kernel shutdown behavior against older fapolicyd behavior. Add --disable-fanotify-fs-error, default it to enabled, and gate the FAN_FS_ERROR implementation on the configure define as well as kernel header support. The disabled build keeps the public helpers as no-ops and logs that monitoring was disabled by configure so the runtime behavior is explicit. Tests were updated so notify_test only exercises synthetic FAN_FS_ERROR events when the configure switch enables the implementation.
The new configure switch compiled out FAN_FS_ERROR handling, but the daemon still unconditionally populated the optional third poll slot from fanotify_fs_error_fd(). That helper returned -1 when disabled, so the runtime behavior was harmless, but the main loop still looked as if it always considered the FS_ERROR descriptor path. Wrap the pfd[2] assignment and pfd_count promotion in FAPOLICYD_ENABLE_FANOTIFY_FS_ERROR. When the feature is disabled at configure time, the daemon no longer assigns or polls the optional FAN_FS_ERROR slot at all.
Keep FAN_FS_ERROR support disabled unconditionally by leaving FAPOLICYD_ENABLE_FANOTIFY_FS_ERROR undefined. The previous configure option is commented out for later restoration, configure reports FAN_FS_ERROR monitoring as no, and the ChangeLog entry advertising FAN_FS_ERROR support was removed from the release notes.
There was a problem hiding this comment.
Code Review
This pull request disables FAN_FS_ERROR health monitoring by default to address a kernel hang issue during shutdown. It introduces the FAPOLICYD_ENABLE_FANOTIFY_FS_ERROR macro to conditionally compile monitoring logic in the daemon and unit tests, and updates the build configuration and ChangeLog to reflect this change. I have no feedback to provide as there were no review comments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The fs_error branch contains work to isolate and disable the FAN_FS_ERROR monitoring. The configure switch is commented out to reduce chances of it being enabled. The the work remains preserved for future use.