linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fengguang Wu <fengguang.wu@intel.com>
To: Namjae Jeon <linkinjeon@gmail.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: Sun, 19 Aug 2012 10:17:57 +0800	[thread overview]
Message-ID: <20120819021757.GB16796@localhost> (raw)
In-Reply-To: <1345283361-7802-1-git-send-email-linkinjeon@gmail.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

> 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

       reply	other threads:[~2012-08-19  2:17 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 ` Fengguang Wu [this message]
2012-08-19 10:23   ` [PATCH 2/3] writeback: fix incorrect return value type of bdi_dirty_limit Marco Stornelli
2012-08-19 10:35     ` Marco Stornelli
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=20120819021757.GB16796@localhost \
    --to=fengguang.wu@intel.com \
    --cc=akpm@linux-foundation.org \
    --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 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).