All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Yang Ruirui <ruirui.r.yang@tieto.com>
Cc: tytso@mit.edu, Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] ext4: release page cache in ext4_mb_load_buddy error path
Date: Thu, 14 Apr 2011 10:01:10 +0300	[thread overview]
Message-ID: <BANLkTinPupXGmYTq16hcgexdUP+czYRc4A@mail.gmail.com> (raw)
In-Reply-To: <20110414064441.GA3499@darkstar>

Hi Yang ,

The patch looks correct, but in my opinion a nicer fix would be to set
e4b->bd_bitmap_page = page;
or
e4b->bd_buddy_page = page;
right after assigning a new value to the temp variable 'page'.
and keeping the cleanup code in the error path as it is.

It's a matter of taste and code readability.

Amir.

On Thu, Apr 14, 2011 at 9:44 AM, Yang Ruirui <ruirui.r.yang@tieto.com> wrote:
> Add missing page_cache_release in the error path of ext4_mb_load_buddy
>
> Signed-off-by: Yang Ruirui <ruirui.r.yang@tieto.com>
> ---
>  fs/ext4/mballoc.c |    2 ++
>  1 file changed, 2 insertions(+)
>
> --- linux-2.6.orig/fs/ext4/mballoc.c    2011-04-14 14:04:48.000000000 +0800
> +++ linux-2.6/fs/ext4/mballoc.c 2011-04-14 14:33:28.702958245 +0800
> @@ -1273,6 +1273,8 @@ repeat_load_buddy:
>        return 0;
>
>  err:
> +       if (page)
> +               page_cache_release(page);
>        if (e4b->bd_bitmap_page)
>                page_cache_release(e4b->bd_bitmap_page);
>        if (e4b->bd_buddy_page)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2011-04-14  7:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-14  6:44 [PATCH] ext4: release page cache in ext4_mb_load_buddy error path Yang Ruirui
2011-04-14  7:01 ` Amir Goldstein [this message]
2011-04-14  7:29   ` Yang Rui Rui
2011-04-14  7:46     ` Amir Goldstein
2011-04-14  8:28       ` Yang Rui Rui
2011-04-16 23:07 ` Ted Ts'o

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=BANLkTinPupXGmYTq16hcgexdUP+czYRc4A@mail.gmail.com \
    --to=amir73il@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=ruirui.r.yang@tieto.com \
    --cc=tytso@mit.edu \
    /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.