Message ID | 20220204091918.278563230@linuxfoundation.org |
---|---|
State | Superseded |
Headers | show |
Series | None | expand |
--- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c @@ -656,9 +656,6 @@ static ssize_t copy_event_to_user(struct if (fanotify_is_perm_event(event->mask)) FANOTIFY_PERM(event)->fd = fd; - if (f) - fd_install(fd, f); - if (info_mode) { ret = copy_info_records_to_user(event, info, info_mode, pidfd, buf, count); @@ -666,6 +663,9 @@ static ssize_t copy_event_to_user(struct goto out_close_fd; } + if (f) + fd_install(fd, f); + return metadata.event_len; out_close_fd: