You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
fsnotify: add groups to fsnotify_inode_groups when registering inode watch
Currently all fsnotify groups are added immediately to the fsnotify_inode_groups list upon creation. This means, even groups with no watches (common for audit) will be on the global tracking list and will get checked for every event. This patch adds groups to the global list on when the first inode mark is added to the group. Signed-of-by: Eric Paris <eparis@redhat.com>
This commit is contained in:
@@ -322,6 +322,13 @@ int fsnotify_add_mark(struct fsnotify_mark_entry *entry,
|
||||
if (unlikely(!inode))
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
* if this group isn't being testing for inode type events we need
|
||||
* to start testing
|
||||
*/
|
||||
if (unlikely(list_empty(&group->inode_group_list)))
|
||||
fsnotify_add_inode_group(group);
|
||||
|
||||
/*
|
||||
* LOCKING ORDER!!!!
|
||||
* entry->lock
|
||||
|
||||
Reference in New Issue
Block a user