fanotify: support restartable permission events#1190
Open
vfsci-bot[bot] wants to merge 2 commits intovfs.base.cifrom
Open
fanotify: support restartable permission events#1190vfsci-bot[bot] wants to merge 2 commits intovfs.base.cifrom
vfsci-bot[bot] wants to merge 2 commits intovfs.base.cifrom
Conversation
Add fanotify_restart_pending_events() helper that walks the access_list and reinserts each pending permission event back into the notification queue for reprocessing. Events are reinserted at the head of the notification queue without merge or overflow handling. Suggested-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/linux-fsdevel/sx5g7pmkchjqucfbzi77xh7wx4wua5nteqi5bsa2hfqgxua2a2@v7x6ja3gsirn/ Signed-off-by: Ibrahim Jirdeh <ibrahimjirdeh@meta.com>
This adds support for restarting permission events. The main goal of the change is to provide better handling for pending events for lazy file loading use cases which may back fanotify events by a long-lived daemon. For prior discussion of approaches see [1][2]. In terms of implementation, we add a new control-fd/queue-fd api. Control fd returned by fanotify_init keeps fanotify group alive and supports operations like fanotify_mark as well as a new ioctl FAN_IOC_OPEN_QUEUE_FD to open a queue fd. Queue fd is used for reading events and writing back responses. Upon release of queue fd, pending permission events are reinserted back into notification queue for reprocessing. Control-fd/queue-fd api is guarded by FAN_RESTARTABLE_EVENTS flag. In addition FAN_RESTARTABLE_EVENTS can only be used in conjunction with FAN_CLASS_CONTENT or FAN_CLASS_PRE_CONTENT, and only permission events can be added to the mark mask if a group is initialized with FAN_RESTARTABLE_EVENTS. [1] https://lore.kernel.org/linux-fsdevel/6za2mngeqslmqjg3icoubz37hbbxi6bi44canfsg2aajgkialt@c3ujlrjzkppr [2] https://lore.kernel.org/linux-fsdevel/20250623192503.2673076-1-ibrahimjirdeh@meta.com Suggested-by: Amir Goldstein <amir73il@gmail.com> Link: https://lore.kernel.org/linux-fsdevel/CAOQ4uxhN6ok6BCBGbxeUt9ULq6g=qL6=_2_QGi8MqTHv5ZN7Vg@mail.gmail.com Signed-off-by: Ibrahim Jirdeh <ibrahimjirdeh@meta.com>
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.
Series: https://patchwork.kernel.org/project/linux-fsdevel/list/?series=1082191
Submitter: Ibrahim Jirdeh
Version: 3
Patches: 2/2
Message-ID:
<20260416194844.3874004-1-ibrahimjirdeh@meta.com>Base: vfs.base.ci
Lore: https://lore.kernel.org/linux-fsdevel/20260416194844.3874004-1-ibrahimjirdeh@meta.com
Automated by ml2pr