Re: [PATCH v5 01/18] fanotify: don't skip extra event info if no info_mode is set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 4, 2024 at 10:29 PM Josef Bacik <josef@xxxxxxxxxxxxxx> wrote:
>
> New pre-content events will be path events but they will also carry
> additional range information. Remove the optimization to skip checking
> whether info structures need to be generated for path events. This
> results in no change in generated info structures for existing events.
>
> Signed-off-by: Josef Bacik <josef@xxxxxxxxxxxxxx>

Reviewed-by: Amir Goldstein <amir73il@xxxxxxxxx>

> ---
>  fs/notify/fanotify/fanotify_user.c | 13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
> index 9ec313e9f6e1..2e2fba8a9d20 100644
> --- a/fs/notify/fanotify/fanotify_user.c
> +++ b/fs/notify/fanotify/fanotify_user.c
> @@ -160,9 +160,6 @@ static size_t fanotify_event_len(unsigned int info_mode,
>         int fh_len;
>         int dot_len = 0;
>
> -       if (!info_mode)
> -               return event_len;
> -
>         if (fanotify_is_error_event(event->mask))
>                 event_len += FANOTIFY_ERROR_INFO_LEN;
>
> @@ -740,12 +737,10 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group,
>         if (fanotify_is_perm_event(event->mask))
>                 FANOTIFY_PERM(event)->fd = fd;
>
> -       if (info_mode) {
> -               ret = copy_info_records_to_user(event, info, info_mode, pidfd,
> -                                               buf, count);
> -               if (ret < 0)
> -                       goto out_close_fd;
> -       }
> +       ret = copy_info_records_to_user(event, info, info_mode, pidfd,
> +                                       buf, count);
> +       if (ret < 0)
> +               goto out_close_fd;
>
>         if (f)
>                 fd_install(fd, f);
> --
> 2.43.0
>





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux