Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 207663
b: refs/heads/master
c: 32c3263
h: refs/heads/master
i:
  207661: d3911e3
  207659: dd5eb5d
  207655: b6ac4b5
  207647: 006ebcc
v: v3
  • Loading branch information
Andreas Gruenbacher authored and Eric Paris committed Jul 28, 2010
1 parent 47e6dc2 commit dbe2aaa
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 22aa425dec9e47051624714ae283eb2b6a473013
refs/heads/master: 32c3263221bd63316815286dccacdc7abfd7f3c4
5 changes: 3 additions & 2 deletions trunk/fs/notify/fanotify/fanotify.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ static bool should_merge(struct fsnotify_event *old, struct fsnotify_event *new)
{
pr_debug("%s: old=%p new=%p\n", __func__, old, new);

if ((old->to_tell == new->to_tell) &&
(old->data_type == new->data_type)) {
if (old->to_tell == new->to_tell &&
old->data_type == new->data_type &&
old->tgid == new->tgid) {
switch (old->data_type) {
case (FSNOTIFY_EVENT_PATH):
if ((old->path.mnt == new->path.mnt) &&
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/notify/fanotify/fanotify_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ static ssize_t fill_event_metadata(struct fsnotify_group *group,
metadata->event_len = FAN_EVENT_METADATA_LEN;
metadata->vers = FANOTIFY_METADATA_VERSION;
metadata->mask = fanotify_outgoing_mask(event->mask);
metadata->pid = pid_vnr(event->tgid);
metadata->fd = create_fd(group, event);

return metadata->fd;
Expand Down
3 changes: 3 additions & 0 deletions trunk/fs/notify/notification.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ void fsnotify_put_event(struct fsnotify_event *event)
BUG_ON(!list_empty(&event->private_data_list));

kfree(event->file_name);
put_pid(event->tgid);
kmem_cache_free(fsnotify_event_cachep, event);
}
}
Expand Down Expand Up @@ -346,6 +347,7 @@ struct fsnotify_event *fsnotify_clone_event(struct fsnotify_event *old_event)
return NULL;
}
}
event->tgid = get_pid(old_event->tgid);
if (event->data_type == FSNOTIFY_EVENT_PATH)
path_get(&event->path);

Expand Down Expand Up @@ -385,6 +387,7 @@ struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask,
event->name_len = strlen(event->file_name);
}

event->tgid = get_pid(task_tgid(current));
event->sync_cookie = cookie;
event->to_tell = to_tell;
event->data_type = data_type;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/fanotify.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ struct fanotify_event_metadata {
__u32 vers;
__s32 fd;
__u64 mask;
__s64 pid;
} __attribute__ ((packed));

/* Helper functions to deal with fanotify_event_metadata buffers */
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/fsnotify_backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ struct fsnotify_event {
u32 sync_cookie; /* used to corrolate events, namely inotify mv events */
char *file_name;
size_t name_len;
struct pid *tgid;

struct list_head private_data_list; /* groups can store private data here */
};
Expand Down

0 comments on commit dbe2aaa

Please sign in to comment.