linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namjae Jeon <linkinjeon@gmail.com>
To: Marco Stornelli <marco.stornelli@gmail.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 2/3] writeback: fix incorrect return value type of bdi_dirty_limit
Date: Mon, 20 Aug 2012 08:49:33 +0900	[thread overview]
Message-ID: <CAKYAXd_+=s+A4GN0Sgmbb9RO94SQFkAvdLDwuZgRu4LFPLsgQA@mail.gmail.com> (raw)
In-Reply-To: <5030BE93.50909@gmail.com>

2012/8/19, Marco Stornelli <marco.stornelli@gmail.com>:
> Il 19/08/2012 04:17, Fengguang Wu ha scritto:
>> On Sat, Aug 18, 2012 at 05:49:21AM -0400, Namjae Jeon wrote:
>>> unsigned long bdi_dirty_limit(struct backing_dev_info *bdi, unsigned long
>>> dirty)
>>>
>>> Above function return type is unsigned long, but return value is
>>> kept in "u64 bdi_dirty".
>>> It can return incorrect value by type casting.
>>
>> I don't see how the cast can return wrong value.
>> The u64 is necessary for the intermediate calculations.
>>
>> Thanks,
>> Fengguang
>>
>
> We are sure u64 is 8byte long, but unsigned long is 4byte long on 32-bit
> machine, so if bdi_dirty can assume values bigger than 2^32 there is an
> implicit truncate of its value, isn't it?
Yes, right.
Thanks.
>
> Marco
>

  parent reply	other threads:[~2012-08-19 23:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1345283361-7802-1-git-send-email-linkinjeon@gmail.com>
2012-08-19  2:17 ` [PATCH 2/3] writeback: fix incorrect return value type of bdi_dirty_limit Fengguang Wu
2012-08-19 10:23   ` Marco Stornelli
2012-08-19 10:35     ` Marco Stornelli
2012-08-19 23:49     ` Namjae Jeon [this message]
2012-08-20  0:09   ` Namjae Jeon

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='CAKYAXd_+=s+A4GN0Sgmbb9RO94SQFkAvdLDwuZgRu4LFPLsgQA@mail.gmail.com' \
    --to=linkinjeon@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=fengguang.wu@intel.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marco.stornelli@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).