Re: [PATCH] fanotify: fill in the metadata_len field on struct fanotify_event_metadata

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

 



Looks ok. Sorry for being a bit slow.

Did you like the FOR_EACH{EVENT,OPTIN}  macros? If so, can we include
FOR_EACH_EVENT in the .37 release, so people could use it regardless
of the kernel version?

On Tue, Dec 7, 2010 at 23:34, Eric Paris <eparis@xxxxxxxxxx> wrote:
> The fanotify_event_metadata now has a field which is supposed to
> indicate the length of the metadata portion of the event. ÂFill in that
> field as well.
>
> Based-in-part-on-patch-by: Alexey Zaytsev <alexey.zaytsev@xxxxxxxxx>
> Signed-off-by: Eric Paris <eparis@xxxxxxxxxx>
> ---
> Âfs/notify/fanotify/fanotify_user.c | Â Â6 ++++--
> Â1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
> index b2e8736..2d4925b 100644
> --- a/fs/notify/fanotify/fanotify_user.c
> +++ b/fs/notify/fanotify/fanotify_user.c
> @@ -127,6 +127,7 @@ static int fill_event_metadata(struct fsnotify_group *group,
> Â Â Â Â Â Â Â Â group, metadata, event);
>
> Â Â Â Âmetadata->event_len = FAN_EVENT_METADATA_LEN;
> + Â Â Â metadata->metadata_len = FAN_EVENT_METADATA_LEN;
> Â Â Â Âmetadata->vers = FANOTIFY_METADATA_VERSION;
> Â Â Â Âmetadata->mask = event->mask & FAN_ALL_OUTGOING_EVENTS;
> Â Â Â Âmetadata->pid = pid_vnr(event->tgid);
> @@ -278,10 +279,11 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group,
> Â Â Â Â Â Â Â Âgoto out_close_fd;
>
> Â Â Â Âret = -EFAULT;
> - Â Â Â if (copy_to_user(buf, &fanotify_event_metadata, FAN_EVENT_METADATA_LEN))
> + Â Â Â if (copy_to_user(buf, &fanotify_event_metadata,
> + Â Â Â Â Â Â Â Â Â Â Â Âfanotify_event_metadata.event_len))
> Â Â Â Â Â Â Â Âgoto out_kill_access_response;
>
> - Â Â Â return FAN_EVENT_METADATA_LEN;
> + Â Â Â return fanotify_event_metadata.event_len;
>
> Âout_kill_access_response:
> Â Â Â Âremove_access_response(group, event, fd);
> --
> 1.7.1
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux