|
@@ -25,7 +25,7 @@ static bool should_merge(struct fsnotify_event *old_fsn,
|
|
|
old = FANOTIFY_E(old_fsn);
|
|
|
new = FANOTIFY_E(new_fsn);
|
|
|
|
|
|
- if (old_fsn->inode == new_fsn->inode && old->tgid == new->tgid &&
|
|
|
+ if (old_fsn->inode == new_fsn->inode && old->pid == new->pid &&
|
|
|
old->path.mnt == new->path.mnt &&
|
|
|
old->path.dentry == new->path.dentry)
|
|
|
return true;
|
|
@@ -171,7 +171,10 @@ struct fanotify_event_info *fanotify_alloc_event(struct fsnotify_group *group,
|
|
|
goto out;
|
|
|
init: __maybe_unused
|
|
|
fsnotify_init_event(&event->fse, inode, mask);
|
|
|
- event->tgid = get_pid(task_tgid(current));
|
|
|
+ if (FAN_GROUP_FLAG(group, FAN_REPORT_TID))
|
|
|
+ event->pid = get_pid(task_pid(current));
|
|
|
+ else
|
|
|
+ event->pid = get_pid(task_tgid(current));
|
|
|
if (path) {
|
|
|
event->path = *path;
|
|
|
path_get(&event->path);
|
|
@@ -270,7 +273,7 @@ static void fanotify_free_event(struct fsnotify_event *fsn_event)
|
|
|
|
|
|
event = FANOTIFY_E(fsn_event);
|
|
|
path_put(&event->path);
|
|
|
- put_pid(event->tgid);
|
|
|
+ put_pid(event->pid);
|
|
|
if (fanotify_is_perm_event(fsn_event->mask)) {
|
|
|
kmem_cache_free(fanotify_perm_event_cachep,
|
|
|
FANOTIFY_PE(fsn_event));
|