X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=fs%2Finotify_user.c;h=9f2224f65a18b9df2831ce2d71365f0c283c47b9;hb=2648e5d9a80d8a020feb343c52a8704e978e60c6;hp=e1956e6f116c8a4c9d6de121a22ec8f463f69373;hpb=ea14fad0d416354a4e9bb1a04f32acba706f9548;p=linux-2.6-omap-h63xx.git diff --git a/fs/inotify_user.c b/fs/inotify_user.c index e1956e6f116..9f2224f65a1 100644 --- 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); - 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; + } 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; - filp->f_vfsmnt = 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;