Commit bdae997f authored by Keith Packard's avatar Keith Packard Committed by Eric Paris

fs/notify/inotify: decrement user inotify count on close

The per-user inotify_devs value is incremented each time a new file is
allocated, but never decremented. This led to inotify_init failing after a
limited number of calls.
Signed-off-by: default avatarKeith Packard <keithp@keithp.com>
Signed-off-by: default avatarEric Paris <eparis@redhat.com>
parent d960eea9
...@@ -296,12 +296,15 @@ static int inotify_fasync(int fd, struct file *file, int on) ...@@ -296,12 +296,15 @@ static int inotify_fasync(int fd, struct file *file, int on)
static int inotify_release(struct inode *ignored, struct file *file) static int inotify_release(struct inode *ignored, struct file *file)
{ {
struct fsnotify_group *group = file->private_data; struct fsnotify_group *group = file->private_data;
struct user_struct *user = group->inotify_data.user;
fsnotify_clear_marks_by_group(group); fsnotify_clear_marks_by_group(group);
/* free this group, matching get was inotify_init->fsnotify_obtain_group */ /* free this group, matching get was inotify_init->fsnotify_obtain_group */
fsnotify_put_group(group); fsnotify_put_group(group);
atomic_dec(&user->inotify_devs);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment