inotify: automatically restart syscalls
authorEric Paris <eparis@redhat.com>
Mon, 26 Mar 2012 17:07:59 +0000 (13:07 -0400)
committerEric Paris <eparis@redhat.com>
Tue, 11 Dec 2012 18:44:37 +0000 (13:44 -0500)
We were mistakenly returning EINTR when we found an outstanding signal.
Instead we should returen ERESTARTSYS and allow the kernel to handle
things the right way.

Patch-from: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
fs/notify/inotify/inotify_user.c

index a6879d1692411cb05aefce8b573f7d9f31f71f6c..463e828f1f312e0a73e5fb86123a979147f74d5c 100644 (file)
@@ -264,7 +264,7 @@ static ssize_t inotify_read(struct file *file, char __user *buf,
                ret = -EAGAIN;
                if (file->f_flags & O_NONBLOCK)
                        break;
-               ret = -EINTR;
+               ret = -ERESTARTSYS;
                if (signal_pending(current))
                        break;