This is a note to let you know that I've just added the patch titled Revert "fanotify: limit number of event merge attempts" to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: revert-fanotify-limit-number-of-event-merge-attempts.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit f876d945cd6f8cfb878a6ae880b4dc24620de580 Author: Chuck Lever <chuck.lever@xxxxxxxxxx> Date: Thu Mar 7 09:22:43 2024 -0500 Revert "fanotify: limit number of event merge attempts" Temporarily revert commit ad3ea16746cc ("fanotify: limit number of event merge attempts") to enable subsequent upstream commits to apply and build cleanly. Stable-dep-of: 8988f11abb82 ("fanotify: reduce event objectid to 29-bit hash") Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c index c3af99e94f1d1..1192c99536200 100644 --- a/fs/notify/fanotify/fanotify.c +++ b/fs/notify/fanotify/fanotify.c @@ -129,15 +129,11 @@ static bool fanotify_should_merge(struct fsnotify_event *old_fsn, return false; } -/* Limit event merges to limit CPU overhead per event */ -#define FANOTIFY_MAX_MERGE_EVENTS 128 - /* and the list better be locked by something too! */ static int fanotify_merge(struct list_head *list, struct fsnotify_event *event) { struct fsnotify_event *test_event; struct fanotify_event *new; - int i = 0; pr_debug("%s: list=%p event=%p\n", __func__, list, event); new = FANOTIFY_E(event); @@ -151,8 +147,6 @@ static int fanotify_merge(struct list_head *list, struct fsnotify_event *event) return 0; list_for_each_entry_reverse(test_event, list, list) { - if (++i > FANOTIFY_MAX_MERGE_EVENTS) - break; if (fanotify_should_merge(test_event, event)) { FANOTIFY_E(test_event)->mask |= new->mask; return 1;