Messages in this thread Patch in this message | | | Date | Thu, 4 Jun 2009 14:05:53 -0700 (PDT) | From | Linus Torvalds <> | Subject | Re: A bug in read operation for /dev/zero and a proposed fix. |
| |
On Thu, 4 Jun 2009, Linus Torvalds wrote: > > If we want to do this for 2.6.30, though, I very much agree with the > notion of limiting it to just fatal signals, though.
IOW, I really think the patch should look like the following, and that this has nothing to do with OOM-killing at all.
Linus --- drivers/char/mem.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 8f05c38..65e12bc 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -694,6 +694,9 @@ static ssize_t read_zero(struct file * file, char __user * buf, written += chunk - unwritten; if (unwritten) break; + /* Consider changing this to just 'signal_pending()' with lots of testing */ + if (fatal_signal_pending(current)) + return written ? written : -EINTR; buf += chunk; count -= chunk; cond_resched();
| |