From: Namjae Jeon <linkinjeon@gmail.com>
To: Fengguang Wu <fengguang.wu@intel.com>
Cc: 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 09:09:42 +0900 [thread overview]
Message-ID: <CAKYAXd8pEYcnLf7+YWF8i4ytO2dhUvt2+85VyC2sttmedPkf_Q@mail.gmail.com> (raw)
In-Reply-To: <20120819021757.GB16796@localhost>
2012/8/19, Fengguang Wu <fengguang.wu@intel.com>:
> 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
Hi Wu.
I understand.
Thanks for your reply.
>
>> Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
>> ---
>> mm/page-writeback.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/mm/page-writeback.c b/mm/page-writeback.c
>> index 49133b6..73a7a06 100644
>> --- a/mm/page-writeback.c
>> +++ b/mm/page-writeback.c
>> @@ -546,7 +546,7 @@ static unsigned long hard_dirty_limit(unsigned long
>> thresh)
>> */
>> unsigned long bdi_dirty_limit(struct backing_dev_info *bdi, unsigned long
>> dirty)
>> {
>> - u64 bdi_dirty;
>> + unsigned long bdi_dirty;
>> long numerator, denominator;
>>
>> /*
>> --
>> 1.7.9.5
>
prev parent reply other threads:[~2012-08-20 0:09 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
2012-08-20 0:09 ` Namjae Jeon [this message]
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=CAKYAXd8pEYcnLf7+YWF8i4ytO2dhUvt2+85VyC2sttmedPkf_Q@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 \
/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).