Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157148
b: refs/heads/master
c: 0db501b
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman authored and Eric Paris committed Aug 27, 2009
1 parent badd2cf commit f547b9b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 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: dead537dd8a1c9495322c1d6f7c780697f474af0
refs/heads/master: 0db501bd0610ee0c0aca84d927f90bcccd09e2bd
13 changes: 6 additions & 7 deletions trunk/fs/notify/inotify/inotify_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@

static struct vfsmount *inotify_mnt __read_mostly;

/* this just sits here and wastes global memory. used to just pad userspace messages with zeros */
static struct inotify_event nul_inotify_event;

/* these are configurable via /proc/sys/fs/inotify/ */
static int inotify_max_user_instances __read_mostly;
static int inotify_max_queued_events __read_mostly;
Expand Down Expand Up @@ -199,8 +196,10 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group,
inotify_free_event_priv(fsn_priv);
}

/* round up event->name_len so it is a multiple of event_size */
name_len = roundup(event->name_len, event_size);
/* round up event->name_len so it is a multiple of event_size
* plus an extra byte for the terminating '\0'.
*/
name_len = roundup(event->name_len + 1, event_size);
inotify_event.len = name_len;

inotify_event.mask = inotify_mask_to_arg(event->mask);
Expand All @@ -224,8 +223,8 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group,
return -EFAULT;
buf += event->name_len;

/* fill userspace with 0's from nul_inotify_event */
if (copy_to_user(buf, &nul_inotify_event, len_to_zero))
/* fill userspace with 0's */
if (clear_user(buf, len_to_zero))
return -EFAULT;
buf += len_to_zero;
event_size += name_len;
Expand Down

0 comments on commit f547b9b

Please sign in to comment.