aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-09 23:40:25 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-09 23:40:25 -0400
commit2b83868723d090078ac0e2120e06a1cc94dbaef0 (patch)
tree3cc99c519f8338a92d46ad290d1415f8bb01c9b2
parent07a2039b8eb0af4ff464efd3dfd95de5c02648c6 (diff)
Make /dev/zero reads interruptible by signals
This helps with bad latencies for large reads from /dev/zero, but might conceivably break some application that "knows" that a read of /dev/zero cannot return early. So do this early in the merge window to give us maximal test coverage, even if the patch is totally trivial. Obviously, no well-behaved application should ever depend on the read being uninterruptible, but hey, bugs happen. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/char/mem.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 65e12bca657c..f96d0bef855e 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -694,9 +694,8 @@ static ssize_t read_zero(struct file * file, char __user * buf,
694 written += chunk - unwritten; 694 written += chunk - unwritten;
695 if (unwritten) 695 if (unwritten)
696 break; 696 break;
697 /* Consider changing this to just 'signal_pending()' with lots of testing */ 697 if (signal_pending(current))
698 if (fatal_signal_pending(current)) 698 return written ? written : -ERESTARTSYS;
699 return written ? written : -EINTR;
700 buf += chunk; 699 buf += chunk;
701 count -= chunk; 700 count -= chunk;
702 cond_resched(); 701 cond_resched();