diff options
author | Eric Paris <eparis@redhat.com> | 2010-10-27 00:10:09 -0400 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2010-10-27 00:12:58 -0400 |
commit | 25f519706b7c7af8fc9a38bc24a2dd69b6f53bcf (patch) | |
tree | cd6bb0183b484f05d5479e65d797443a86ad407c /include | |
parent | 8bcf8e8ff11d5da4e03601d7299975b0e0c1410a (diff) |
fanotify: limit number of listeners per user
fanotify currently has no limit on the number of listeners a given user can
have open. This patch limits the total number of listeners per user to
128. This is the same as the inotify default limit.
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/fsnotify_backend.h | 1 | ||||
-rw-r--r-- | include/linux/sched.h | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index f839523463de..ceb02b797b07 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h @@ -163,6 +163,7 @@ struct fsnotify_group { #endif /* CONFIG_FANOTIFY_ACCESS_PERMISSIONS */ int f_flags; unsigned int max_marks; + struct user_struct *user; } fanotify_data; #endif /* CONFIG_FANOTIFY */ }; diff --git a/include/linux/sched.h b/include/linux/sched.h index 56154bbb8da9..21a86da80e0b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -668,6 +668,9 @@ struct user_struct { atomic_t inotify_watches; /* How many inotify watches does this user have? */ atomic_t inotify_devs; /* How many inotify devs does this user have opened? */ #endif +#ifdef CONFIG_FANOTIFY + atomic_t fanotify_listeners; +#endif #ifdef CONFIG_EPOLL atomic_t epoll_watches; /* The number of file descriptors currently watched */ #endif |