projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[firefly-linux-kernel-4.4.55.git]
/
fs
/
inotify_user.c
diff --git
a/fs/inotify_user.c
b/fs/inotify_user.c
index 55f6da55b7c0ec36f8e76307c512999570103e4e..9f2224f65a18b9df2831ce2d71365f0c283c47b9 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;