linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Filipe David Manana <fdmanana@gmail.com>
To: Naohiro Aota <naota@elisp.net>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] btrfs-progs: Do not free dirty extent buffer
Date: Sat, 23 Aug 2014 19:45:22 +0100	[thread overview]
Message-ID: <CAL3q7H61-uAP08uXNzsZfwKT8h1ZjRAR_GvD69wRKuRPpkbh9A@mail.gmail.com> (raw)
In-Reply-To: <87mway82qp.fsf@elisp.net>

On Thu, Aug 21, 2014 at 1:07 PM, Naohiro Aota <naota@elisp.net> wrote:
> free_some_buffer() should not free dirty extent buffers. They should be
> left for later commit.
>
> Signed-off-by: Naohiro Aota <naota@elisp.net>
> ---
>  extent_io.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/extent_io.c b/extent_io.c
> index a127e54..8a668be 100644
> --- a/extent_io.c
> +++ b/extent_io.c
> @@ -552,7 +552,7 @@ static int free_some_buffers(struct extent_io_tree *tree)
>
>         list_for_each_safe(node, next, &tree->lru) {
>                 eb = list_entry(node, struct extent_buffer, lru);
> -               if (eb->refs == 1) {
> +               if (eb->refs == 1 && !(eb->flags && EXTENT_DIRTY)) {

Hi,

Did you meant bitwise and (&) and not logical and (&&) right?


>                         free_extent_buffer(eb);
>                         if (tree->cache_size < cache_hard_max)
>                                 break;
> --
> 2.0.4
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Filipe David Manana,

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

  reply	other threads:[~2014-08-23 18:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-21 12:07 [PATCH] btrfs-progs: Do not free dirty extent buffer Naohiro Aota
2014-08-23 18:45 ` Filipe David Manana [this message]
2014-08-25  5:09   ` Naohiro Aota

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=CAL3q7H61-uAP08uXNzsZfwKT8h1ZjRAR_GvD69wRKuRPpkbh9A@mail.gmail.com \
    --to=fdmanana@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=naota@elisp.net \
    /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).