lkml.org 
[lkml]   [2009]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] block: sysfs fix mismatched queue_var_{store,show} in 64bit kernel
On Tue, Jul 14, 2009 at 07:56:58PM +0800, Xiaotian Feng wrote:
> In blk-sysfs.c, queue_var_store uses unsigned long to store data,
> but queue_var_show uses unsigned int to show data. This causes,
>
> # echo 70000000000 > /sys/block/<dev>/queue/read_ahead_kb
> # cat /sys/block/<dev>/queue/read_ahead_kb => get wrong value
>
> Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
> ---
> block/blk-sysfs.c | 13 +++++++------
> 1 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
> index b1cd040..e177eb3 100644
> --- a/block/blk-sysfs.c
> +++ b/block/blk-sysfs.c
> @@ -16,9 +16,9 @@ struct queue_sysfs_entry {
> };
>
> static ssize_t
> -queue_var_show(unsigned int var, char *page)
> +queue_var_show(unsigned long var, char *page)
> {
> - return sprintf(page, "%d\n", var);
> + return sprintf(page, "lu\n", var);

%lu, I guess?


\
 
 \ /
  Last update: 2009-07-14 16:13    [W:0.075 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site