[<prev] [next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0707171225050.26781@alien.or.mcafeemobile.com>
Date: Tue, 17 Jul 2007 12:37:01 -0700 (PDT)
From: Davide Libenzi <davidel@...ilserver.org>
To: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
cc: Andrew Morton <akpm@...ux-foundation.org>,
Michael Kerrisk <mtk-manpages@....net>,
Davi Arnaut <davi@...ent.com.br>
Subject: [patch] make timerfd return a u64 and fix the __put_user
Davi fixed a missing cast in the __put_user(), that was making timerfd
return a single byte instead of the full value.
Talking with Michael about the timerfd man page, we think it'd be better
to use a u64 for the returned value, to align it with the eventfd
implementation.
Signed-off-by: Davide Libenzi <davidel@...ilserver.org>
- Davide
---
fs/timerfd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Index: linux-2.6.mod/fs/timerfd.c
===================================================================
--- linux-2.6.mod.orig/fs/timerfd.c 2007-07-17 12:20:15.000000000 -0700
+++ linux-2.6.mod/fs/timerfd.c 2007-07-17 12:21:09.000000000 -0700
@@ -95,7 +95,7 @@
{
struct timerfd_ctx *ctx = file->private_data;
ssize_t res;
- u32 ticks = 0;
+ u64 ticks = 0;
DECLARE_WAITQUEUE(wait, current);
if (count < sizeof(ticks))
@@ -130,7 +130,7 @@
* callback to avoid DoS attacks specifying a very
* short timer period.
*/
- ticks = (u32)
+ ticks = (u64)
hrtimer_forward(&ctx->tmr,
hrtimer_cb_get_time(&ctx->tmr),
ctx->tintv);
@@ -140,7 +140,7 @@
}
spin_unlock_irq(&ctx->wqh.lock);
if (ticks)
- res = put_user(ticks, buf) ? -EFAULT: sizeof(ticks);
+ res = put_user(ticks, (u64 __user *) buf) ? -EFAULT: sizeof(ticks);
return res;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists