[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKYAXd_+=s+A4GN0Sgmbb9RO94SQFkAvdLDwuZgRu4LFPLsgQA@mail.gmail.com>
Date: Mon, 20 Aug 2012 08:49:33 +0900
From: Namjae Jeon <linkinjeon@...il.com>
To: Marco Stornelli <marco.stornelli@...il.com>
Cc: Fengguang Wu <fengguang.wu@...el.com>, akpm@...ux-foundation.org,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 2/3] writeback: fix incorrect return value type of bdi_dirty_limit
2012/8/19, Marco Stornelli <marco.stornelli@...il.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
>
--
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