Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753057AbZFDVGG (ORCPT ); Thu, 4 Jun 2009 17:06:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751364AbZFDVF4 (ORCPT ); Thu, 4 Jun 2009 17:05:56 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:38873 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751331AbZFDVFz (ORCPT ); Thu, 4 Jun 2009 17:05:55 -0400 Date: Thu, 4 Jun 2009 14:05:53 -0700 (PDT) From: Linus Torvalds X-X-Sender: torvalds@localhost.localdomain To: Andrew Morton cc: Salman Qazi , linux-kernel@vger.kernel.org, Nick Piggin Subject: Re: A bug in read operation for /dev/zero and a proposed fix. In-Reply-To: Message-ID: References: <20090604135050.ceb6bf18.akpm@linux-foundation.org> User-Agent: Alpine 2.01 (LFD 1184 2008-12-16) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1126 Lines: 34 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(); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/