diff options
| author | Jan Kara <jack@suse.cz> | 2014-01-28 12:53:22 -0500 |
|---|---|---|
| committer | Jan Kara <jack@suse.cz> | 2014-01-29 07:57:10 -0500 |
| commit | 83c0e1b442b488571f4fef4a91c2fe52eed6c705 (patch) | |
| tree | b29a85223f2e5e166f075266edb1bf2e0ef5cf57 /include/linux | |
| parent | 13116dfd13c8c9d60ea04ece13419af2de8e2e37 (diff) | |
fsnotify: Do not return merged event from fsnotify_add_notify_event()
The event returned from fsnotify_add_notify_event() cannot ever be used
safely as the event may be freed by the time the function returns (after
dropping notification_mutex). So change the prototype to just return
whether the event was added or merged into some existing event.
Reported-and-tested-by: Jiri Kosina <jkosina@suse.cz>
Reported-and-tested-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/fsnotify_backend.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index 7d8d5e608594..3d286ff49ab0 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
| @@ -322,10 +322,10 @@ extern int fsnotify_fasync(int fd, struct file *file, int on); | |||
| 322 | extern void fsnotify_destroy_event(struct fsnotify_group *group, | 322 | extern void fsnotify_destroy_event(struct fsnotify_group *group, |
| 323 | struct fsnotify_event *event); | 323 | struct fsnotify_event *event); |
| 324 | /* attach the event to the group notification queue */ | 324 | /* attach the event to the group notification queue */ |
| 325 | extern struct fsnotify_event *fsnotify_add_notify_event(struct fsnotify_group *group, | 325 | extern int fsnotify_add_notify_event(struct fsnotify_group *group, |
| 326 | struct fsnotify_event *event, | 326 | struct fsnotify_event *event, |
| 327 | struct fsnotify_event *(*merge)(struct list_head *, | 327 | int (*merge)(struct list_head *, |
| 328 | struct fsnotify_event *)); | 328 | struct fsnotify_event *)); |
| 329 | /* true if the group notification queue is empty */ | 329 | /* true if the group notification queue is empty */ |
| 330 | extern bool fsnotify_notify_queue_is_empty(struct fsnotify_group *group); | 330 | extern bool fsnotify_notify_queue_is_empty(struct fsnotify_group *group); |
| 331 | /* return, but do not dequeue the first event on the notification queue */ | 331 | /* return, but do not dequeue the first event on the notification queue */ |
