diff options
-rw-r--r-- | fs/notify/fanotify/fanotify_user.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index 063224812b7e..045c0794d435 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c | |||
@@ -106,7 +106,7 @@ static int create_fd(struct fsnotify_group *group, struct fsnotify_event *event) | |||
106 | return client_fd; | 106 | return client_fd; |
107 | } | 107 | } |
108 | 108 | ||
109 | static ssize_t fill_event_metadata(struct fsnotify_group *group, | 109 | static int fill_event_metadata(struct fsnotify_group *group, |
110 | struct fanotify_event_metadata *metadata, | 110 | struct fanotify_event_metadata *metadata, |
111 | struct fsnotify_event *event) | 111 | struct fsnotify_event *event) |
112 | { | 112 | { |
@@ -257,10 +257,11 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group, | |||
257 | 257 | ||
258 | pr_debug("%s: group=%p event=%p\n", __func__, group, event); | 258 | pr_debug("%s: group=%p event=%p\n", __func__, group, event); |
259 | 259 | ||
260 | fd = fill_event_metadata(group, &fanotify_event_metadata, event); | 260 | ret = fill_event_metadata(group, &fanotify_event_metadata, event); |
261 | if (fd < 0) | 261 | if (ret < 0) |
262 | return fd; | 262 | goto out; |
263 | 263 | ||
264 | fd = ret; | ||
264 | ret = prepare_for_access_response(group, event, fd); | 265 | ret = prepare_for_access_response(group, event, fd); |
265 | if (ret) | 266 | if (ret) |
266 | goto out_close_fd; | 267 | goto out_close_fd; |
@@ -275,6 +276,13 @@ out_kill_access_response: | |||
275 | remove_access_response(group, event, fd); | 276 | remove_access_response(group, event, fd); |
276 | out_close_fd: | 277 | out_close_fd: |
277 | sys_close(fd); | 278 | sys_close(fd); |
279 | out: | ||
280 | #ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS | ||
281 | if (event->mask & FAN_ALL_PERM_EVENTS) { | ||
282 | event->response = FAN_DENY; | ||
283 | wake_up(&group->fanotify_data.access_waitq); | ||
284 | } | ||
285 | #endif | ||
278 | return ret; | 286 | return ret; |
279 | } | 287 | } |
280 | 288 | ||