linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Behrens <sbehrens@giantdisaster.de>
To: Josef Bacik <jbacik@fusionio.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: fix page leakage
Date: Thu, 11 Oct 2012 15:13:14 +0200	[thread overview]
Message-ID: <5076C5EA.3020602@giantdisaster.de> (raw)
In-Reply-To: <1349470500-7328-1-git-send-email-jbacik@fusionio.com>

On Fri, 5 Oct 2012 16:55:00 -0400, Josef Bacik wrote:
> Alloc_dummy_extent_buffer will not free the first page in the eb array if we
> fail to allocate a page, fix this.  Thanks,
> 
> Reported-by: David Sterba <dave@jikos.cz>
> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
> ---
>  fs/btrfs/extent_io.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index 7dc69b3..64dc93f 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -4104,7 +4104,7 @@ struct extent_buffer *alloc_dummy_extent_buffer(u64 start, unsigned long len)
>  
>  	return eb;
>  err:
> -	for (i--; i > 0; i--)
> +	for (i--; i >= 0; i--)
>  		__free_page(eb->pages[i]);
>  	__free_extent_buffer(eb);
>  	return NULL;
> 

gcc says "warning: comparison of unsigned expression >= 0 is always
true" because i is an unsigned long. And gcc is right this time.

Reviewed-And-Rejected-By: gcc

      reply	other threads:[~2012-10-11 13:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-05 20:55 [PATCH] Btrfs: fix page leakage Josef Bacik
2012-10-11 13:13 ` Stefan Behrens [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=5076C5EA.3020602@giantdisaster.de \
    --to=sbehrens@giantdisaster.de \
    --cc=jbacik@fusionio.com \
    --cc=linux-btrfs@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).