timer_list: correct the iterator for timer_list
authorNathan Zimmer <nzimmer@sgi.com>
Wed, 28 Aug 2013 23:35:14 +0000 (16:35 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 29 Aug 2013 02:26:38 +0000 (19:26 -0700)
commit84a78a6504f5c5394a8e558702e5b54131f01d14
treebd56909861d573e35ef940182891fe1eb210fec8
parentfa8218def1b1a16f0a410e2c1c767b4738cc81fa
timer_list: correct the iterator for timer_list

Correct an issue with /proc/timer_list reported by Holger.

When reading from the proc file with a sufficiently small buffer, 2k so
not really that small, there was one could get hung trying to read the
file a chunk at a time.

The timer_list_start function failed to account for the possibility that
the offset was adjusted outside the timer_list_next.

Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
Reported-by: Holger Hans Peter Freyther <holger@freyther.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Berke Durak <berke.durak@xiphos.com>
Cc: Jeff Layton <jlayton@redhat.com>
Tested-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: <stable@vger.kernel.org> # 3.10.x
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/time/timer_list.c