瀏覽代碼

inotify: drop user watch count when a watch is removed

The inotify rewrite forgot to drop the inotify watch use cound when a watch
was removed.  This means that a single inotify fd can only ever register a
maximum of /proc/sys/fs/max_user_watches even if some of those had been
freed.

Signed-off-by: Eric Paris <eparis@redhat.com>
Eric Paris 16 年之前
父節點
當前提交
5549f7cdf8
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      fs/notify/inotify/inotify_user.c

+ 2 - 0
fs/notify/inotify/inotify_user.c

@@ -404,6 +404,8 @@ skip_send_ignore:
 
 	/* removed from idr, drop that reference */
 	fsnotify_put_mark(entry);
+
+	atomic_dec(&group->inotify_data.user->inotify_watches);
 }
 
 /* ding dong the mark is dead */