* [PATCH] make fanotify_read() restartable across signals
@ 2010-10-29 10:06 Lino Sanfilippo
2010-10-29 13:53 ` Eric Paris
0 siblings, 1 reply; 2+ messages in thread
From: Lino Sanfilippo @ 2010-10-29 10:06 UTC (permalink / raw)
To: eparis; +Cc: linux-kernel, linux-fsdevel
In fanotify_read() return -ERESTARTSYS instead of -EINTR to
make read() restartable across signals (BSD semantic).
---
This patch applies against commit 3970d817558a426cc2f53eaa01182eb9452e0cb1
of branch 'origin/for-next' from git.infradead.org/users/eparis/notify.git
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index 8c9fd35..99a8e60 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -330,7 +330,7 @@ static ssize_t fanotify_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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] make fanotify_read() restartable across signals
2010-10-29 10:06 [PATCH] make fanotify_read() restartable across signals Lino Sanfilippo
@ 2010-10-29 13:53 ` Eric Paris
0 siblings, 0 replies; 2+ messages in thread
From: Eric Paris @ 2010-10-29 13:53 UTC (permalink / raw)
To: Lino Sanfilippo; +Cc: linux-kernel, linux-fsdevel
On Fri, 2010-10-29 at 12:06 +0200, Lino Sanfilippo wrote:
> In fanotify_read() return -ERESTARTSYS instead of -EINTR to
> make read() restartable across signals (BSD semantic).
Looks good, I'll add it today.
Thanks!
-Eric
> ---
> This patch applies against commit 3970d817558a426cc2f53eaa01182eb9452e0cb1
> of branch 'origin/for-next' from git.infradead.org/users/eparis/notify.git
>
> diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
> index 8c9fd35..99a8e60 100644
> --- a/fs/notify/fanotify/fanotify_user.c
> +++ b/fs/notify/fanotify/fanotify_user.c
> @@ -330,7 +330,7 @@ static ssize_t fanotify_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;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-10-29 13:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-29 10:06 [PATCH] make fanotify_read() restartable across signals Lino Sanfilippo
2010-10-29 13:53 ` Eric Paris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).