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

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git-commits-head@...>
Date: Friday, July 3, 2009 - 5:59 pm

Gitweb:     http://git.kernel.org/linus/bdae997f44535ac4ebe1e055ffe59eeee946f453
Commit:     bdae997f44535ac4ebe1e055ffe59eeee946f453
Parent:     d960eea974f5e500c0dcb95a934239cc1f481cfd
Author:     Keith Packard <keithp@keithp.com>
AuthorDate: Wed Jul 1 21:56:38 2009 -0700
Committer:  Eric Paris <eparis@redhat.com>
CommitDate: Thu Jul 2 08:23:00 2009 -0400

    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>
---
 fs/notify/inotify/inotify_user.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
index ff231ad..ff27a29 100644
--- a/fs/notify/inotify/inotify_user.c
+++ b/fs/notify/inotify/inotify_user.c
@@ -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)
 {
 	struct fsnotify_group *group = file->private_data;
+	struct user_struct *user = group->inotify_data.user;
 
 	fsnotify_clear_marks_by_group(group);
 
 	/* free this group, matching get was inotify_init->fsnotify_obtain_group */
 	fsnotify_put_group(group);
 
+	atomic_dec(&user->inotify_devs);
+
 	return 0;
 }
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
fs/notify/inotify: decrement user inotify count on close, Linux Kernel Mailing List..., (Fri Jul 3, 5:59 pm)