summaryrefslogtreecommitdiff
path: root/fs/notify/inode_mark.c
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2009-12-17 21:24:23 -0500
committerEric Paris <eparis@redhat.com>2010-07-28 09:58:51 -0400
commit4ca763523e040dc61191d4866a82981a5d30a4e9 (patch)
tree9b02105e7c84853dd89eff16837a9b7fba2a1050 /fs/notify/inode_mark.c
parent36fddebaa8a9186d4f5817ab798a83400b2fb2e7 (diff)
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>
Diffstat (limited to 'fs/notify/inode_mark.c')
-rw-r--r--fs/notify/inode_mark.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/notify/inode_mark.c b/fs/notify/inode_mark.c
index 7d2962e5328e..a3230c485531 100644
--- a/fs/notify/inode_mark.c
+++ b/fs/notify/inode_mark.c
@@ -323,6 +323,13 @@ int fsnotify_add_mark(struct fsnotify_mark_entry *entry,
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
* group->mark_lock