Skip to content

Merge the fs_error branch#410

Merged
stevegrubb merged 3 commits into
mainfrom
fs_error
May 20, 2026
Merged

Merge the fs_error branch#410
stevegrubb merged 3 commits into
mainfrom
fs_error

Conversation

@stevegrubb

Copy link
Copy Markdown
Member

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.

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.
@stevegrubb stevegrubb merged commit 59b7dad into main May 20, 2026
9 of 17 checks passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant