lkml.org 
[lkml]   [2006]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 3/7] [hrtimers] Fix oldvalue return in setitimer

    This resolves bugzilla bug#5617. The oldvalue of the
    timer was read after the timer was cancelled, so the
    remaining time was always zero.

    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

    ---

    kernel/itimer.c | 10 +++++-----
    1 files changed, 5 insertions(+), 5 deletions(-)

    3f59dd20898d805781b3eac7ed0807e7a0b30f2f
    diff --git a/kernel/itimer.c b/kernel/itimer.c
    index 6433d06..379be2f 100644
    --- a/kernel/itimer.c
    +++ b/kernel/itimer.c
    @@ -155,16 +155,16 @@ int do_setitimer(int which, struct itime
    again:
    spin_lock_irq(&tsk->sighand->siglock);
    timer = &tsk->signal->real_timer;
    - /* We are sharing ->siglock with it_real_fn() */
    - if (hrtimer_try_to_cancel(timer) < 0) {
    - spin_unlock_irq(&tsk->sighand->siglock);
    - goto again;
    - }
    if (ovalue) {
    ovalue->it_value = itimer_get_remtime(timer);
    ovalue->it_interval
    = ktime_to_timeval(tsk->signal->it_real_incr);
    }
    + /* We are sharing ->siglock with it_real_fn() */
    + if (hrtimer_try_to_cancel(timer) < 0) {
    + spin_unlock_irq(&tsk->sighand->siglock);
    + goto again;
    + }
    tsk->signal->it_real_incr =
    timeval_to_ktime(value->it_interval);
    expires = timeval_to_ktime(value->it_value);
    --
    1.0.8
    --

    -
    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/

    \
     
     \ /
      Last update: 2006-01-20 03:58    [W:0.023 / U:29.412 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site