Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157162
b: refs/heads/master
c: 83cb10f
h: refs/heads/master
v: v3
  • Loading branch information
Eric Paris committed Aug 28, 2009
1 parent 70e7777 commit d6b6f25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 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: b962e7312ae87006aed6f68ceee94bdf8db08338
refs/heads/master: 83cb10f0ef3c96162be92339ccf8c0c9c9f2d13e
8 changes: 5 additions & 3 deletions trunk/fs/notify/inotify/inotify_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ static struct fsnotify_event *get_one_event(struct fsnotify_group *group,

event = fsnotify_peek_notify_event(group);

event_size += roundup(event->name_len, event_size);
if (event->name_len)
event_size += roundup(event->name_len + 1, event_size);

if (event_size > count)
return ERR_PTR(-EINVAL);
Expand Down Expand Up @@ -327,8 +328,9 @@ static long inotify_ioctl(struct file *file, unsigned int cmd,
list_for_each_entry(holder, &group->notification_list, event_list) {
event = holder->event;
send_len += sizeof(struct inotify_event);
send_len += roundup(event->name_len,
sizeof(struct inotify_event));
if (event->name_len)
send_len += roundup(event->name_len + 1,
sizeof(struct inotify_event));
}
mutex_unlock(&group->notification_mutex);
ret = put_user(send_len, (int __user *) p);
Expand Down

0 comments on commit d6b6f25

Please sign in to comment.