lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 14 Jul 2009 21:53:49 +0800
From:	Américo Wang <xiyou.wangcong@...il.com>
To:	Xiaotian Feng <dfeng@...hat.com>
Cc:	axboe@...nel.dk, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] block: sysfs fix mismatched queue_var_{store,show} in 
	64bit kernel

On Tue, Jul 14, 2009 at 7:56 PM, Xiaotian Feng<dfeng@...hat.com> 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@...hat.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

>  }
>
>  static ssize_t
> @@ -77,7 +77,8 @@ queue_requests_store(struct request_queue *q, const char *page, size_t count)
>
>  static ssize_t queue_ra_show(struct request_queue *q, char *page)
>  {
> -       int ra_kb = q->backing_dev_info.ra_pages << (PAGE_CACHE_SHIFT - 10);
> +       unsigned long ra_kb = q->backing_dev_info.ra_pages <<
> +                                       (PAGE_CACHE_SHIFT - 10);


It looks like that your email client replaces tab's with spaces.
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ