git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix select on /proc files without ->poll
[pandora-kernel.git]
/
fs
/
inotify_user.c
diff --git
a/fs/inotify_user.c
b/fs/inotify_user.c
index
e1956e6
..
9bf2f6c
100644
(file)
--- a/
fs/inotify_user.c
+++ b/
fs/inotify_user.c
@@
-455,8
+455,16
@@
static ssize_t inotify_read(struct file *file, char __user *buf,
break;
kevent = inotify_dev_get_event(dev);
break;
kevent = inotify_dev_get_event(dev);
- if (event_size + kevent->event.len > count)
+ if (event_size + kevent->event.len > count) {
+ if (ret == 0 && count > 0) {
+ /*
+ * could not get a single event because we
+ * didn't have enough buffer space.
+ */
+ ret = -EINVAL;
+ }
break;
break;
+ }
if (copy_to_user(buf, &kevent->event, event_size)) {
ret = -EFAULT;
if (copy_to_user(buf, &kevent->event, event_size)) {
ret = -EFAULT;
@@
-570,9
+578,9
@@
asmlinkage long sys_inotify_init(void)
dev->ih = ih;
filp->f_op = &inotify_fops;
dev->ih = ih;
filp->f_op = &inotify_fops;
- filp->f_
vfs
mnt = mntget(inotify_mnt);
- filp->f_dentry = dget(inotify_mnt->mnt_root);
- filp->f_mapping = filp->f_dentry->d_inode->i_mapping;
+ filp->f_
path.
mnt = mntget(inotify_mnt);
+ filp->f_
path.
dentry = dget(inotify_mnt->mnt_root);
+ filp->f_mapping = filp->f_
path.
dentry->d_inode->i_mapping;
filp->f_mode = FMODE_READ;
filp->f_flags = O_RDONLY;
filp->private_data = dev;
filp->f_mode = FMODE_READ;
filp->f_flags = O_RDONLY;
filp->private_data = dev;
@@
-708,10
+716,10
@@
static int __init inotify_user_setup(void)
watch_cachep = kmem_cache_create("inotify_watch_cache",
sizeof(struct inotify_user_watch),
watch_cachep = kmem_cache_create("inotify_watch_cache",
sizeof(struct inotify_user_watch),
- 0, SLAB_PANIC, NULL
, NULL
);
+ 0, SLAB_PANIC, NULL);
event_cachep = kmem_cache_create("inotify_event_cache",
sizeof(struct inotify_kernel_event),
event_cachep = kmem_cache_create("inotify_event_cache",
sizeof(struct inotify_kernel_event),
- 0, SLAB_PANIC, NULL
, NULL
);
+ 0, SLAB_PANIC, NULL);
return 0;
}
return 0;
}