All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marco Stornelli <marco.stornelli@gmail.com>
To: Fengguang Wu <fengguang.wu@intel.com>
Cc: Namjae Jeon <linkinjeon@gmail.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: Sun, 19 Aug 2012 12:35:42 +0200	[thread overview]
Message-ID: <5030C17E.5050906@gmail.com> (raw)
In-Reply-To: <5030BE93.50909@gmail.com>

Il 19/08/2012 12:23, Marco Stornelli ha scritto:
> 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?
>
> Marco

Sorry but I didn't see the code, it seems not possible so the wrong 
situation can't happen. Maybe we can simply add a comment, nothing more.

Marco

  reply	other threads:[~2012-08-19 10:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-18  9:49 [PATCH 2/3] writeback: fix incorrect return value type of bdi_dirty_limit Namjae Jeon
2012-08-19  2:17 ` Fengguang Wu
2012-08-19 10:23   ` Marco Stornelli
2012-08-19 10:35     ` Marco Stornelli [this message]
2012-08-19 23:49     ` Namjae Jeon
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=5030C17E.5050906@gmail.com \
    --to=marco.stornelli@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=fengguang.wu@intel.com \
    --cc=linkinjeon@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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.