diff options
-rw-r--r-- | fs/notify/group.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/notify/group.c b/fs/notify/group.c index c80809745312..656c534ffb66 100644 --- a/fs/notify/group.c +++ b/fs/notify/group.c | |||
@@ -82,9 +82,6 @@ static void fsnotify_add_group(struct fsnotify_group *group) | |||
82 | BUG_ON(!mutex_is_locked(&fsnotify_grp_mutex)); | 82 | BUG_ON(!mutex_is_locked(&fsnotify_grp_mutex)); |
83 | 83 | ||
84 | group->on_inode_group_list = 1; | 84 | group->on_inode_group_list = 1; |
85 | /* being on the fsnotify_groups list holds one num_marks */ | ||
86 | atomic_inc(&group->num_marks); | ||
87 | |||
88 | list_add_tail_rcu(&group->inode_group_list, &fsnotify_inode_groups); | 85 | list_add_tail_rcu(&group->inode_group_list, &fsnotify_inode_groups); |
89 | } | 86 | } |
90 | 87 | ||
@@ -183,7 +180,14 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops) | |||
183 | if (!group) | 180 | if (!group) |
184 | return ERR_PTR(-ENOMEM); | 181 | return ERR_PTR(-ENOMEM); |
185 | 182 | ||
183 | /* set to 0 when there a no external references to this group */ | ||
186 | atomic_set(&group->refcnt, 1); | 184 | atomic_set(&group->refcnt, 1); |
185 | /* | ||
186 | * hits 0 when there are no external references AND no marks for | ||
187 | * this group | ||
188 | */ | ||
189 | atomic_set(&group->num_marks, 1); | ||
190 | |||
187 | 191 | ||
188 | mutex_init(&group->notification_mutex); | 192 | mutex_init(&group->notification_mutex); |
189 | INIT_LIST_HEAD(&group->notification_list); | 193 | INIT_LIST_HEAD(&group->notification_list); |