Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 5549f7c

Browse files
committed
inotify: drop user watch count when a watch is removed
The inotify rewrite forgot to drop the inotify watch use cound when a watch was removed. This means that a single inotify fd can only ever register a maximum of /proc/sys/fs/max_user_watches even if some of those had been freed. Signed-off-by: Eric Paris <[email protected]>
1 parent aea1f79 commit 5549f7c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/notify/inotify/inotify_user.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,8 @@ void inotify_ignored_and_remove_idr(struct fsnotify_mark_entry *entry,
404404

405405
/* removed from idr, drop that reference */
406406
fsnotify_put_mark(entry);
407+
408+
atomic_dec(&group->inotify_data.user->inotify_watches);
407409
}
408410

409411
/* ding dong the mark is dead */

0 commit comments

Comments
 (0)