All of lore.kernel.org
 help / color / mirror / Atom feed
From: Danny Feng <dfeng@redhat.com>
To: "Américo Wang" <xiyou.wangcong@gmail.com>
Cc: axboe@kernel.dk, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] block: sysfs fix mismatched queue_var_{store,show} in 64bit kernel
Date: Tue, 14 Jul 2009 23:00:30 +0800	[thread overview]
Message-ID: <4A5C9D8E.1010809@redhat.com> (raw)
In-Reply-To: <2375c9f90907140653n3d689416jac8fbff43237fc15@mail.gmail.com>

On 07/14/2009 09:53 PM, Américo Wang wrote:
> On Tue, Jul 14, 2009 at 7:56 PM, Xiaotian Feng<dfeng@redhat.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@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
>
My mistake, correct in V2. Thank you.
>>   }
>>
>>   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.
I use git send-email, and in my thunderbird, they're all tabs...

  reply	other threads:[~2009-07-14 15:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-14 11:56 [PATCH] block: sysfs fix mismatched queue_var_{store,show} in 64bit kernel Xiaotian Feng
2009-07-14 13:53 ` Américo Wang
2009-07-14 15:00   ` Danny Feng [this message]
2009-07-14 14:10 ` Johannes Weiner
2009-07-14 14:15 ` [PATCH V2] " Xiaotian Feng
2009-07-17  6:48   ` Tejun Heo
2009-07-17  7:39     ` Danny Feng
2009-07-17  7:53       ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A5C9D8E.1010809@redhat.com \
    --to=dfeng@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.