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: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Paris <eparis@redhat.com>

authored by Keith Packard and committed by Eric Paris bdae997f d960eea9

+3
+3
fs/notify/inotify/inotify_user.c
··· 296 static int inotify_release(struct inode *ignored, struct file *file) 297 { 298 struct fsnotify_group *group = file->private_data; 299 300 fsnotify_clear_marks_by_group(group); 301 302 /* free this group, matching get was inotify_init->fsnotify_obtain_group */ 303 fsnotify_put_group(group); 304 305 return 0; 306 }
··· 296 static int inotify_release(struct inode *ignored, struct file *file) 297 { 298 struct fsnotify_group *group = file->private_data; 299 + struct user_struct *user = group->inotify_data.user; 300 301 fsnotify_clear_marks_by_group(group); 302 303 /* free this group, matching get was inotify_init->fsnotify_obtain_group */ 304 fsnotify_put_group(group); 305 + 306 + atomic_dec(&user->inotify_devs); 307 308 return 0; 309 }