From: Liu Bo <bo.li.liu@oracle.com>
To: Josef Bacik <jbacik@fusionio.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: do not merge logged extents if we've removed them from the tree
Date: Tue, 29 Jan 2013 10:31:32 +0800 [thread overview]
Message-ID: <20130129023131.GC15654@liubo.jp.oracle.com> (raw)
In-Reply-To: <1359384776-2107-1-git-send-email-jbacik@fusionio.com>
On Mon, Jan 28, 2013 at 09:52:56AM -0500, Josef Bacik wrote:
> You can run into this problem where if somebody is fsyncing and writing out
> the existing extents you will have removed the extent map from the em tree,
> but it's still valid for the current fsync so we go ahead and write it. The
> problem is we unconditionally try to merge it back into the em tree, but if
> we've removed it from the em tree that will cause problems. So fix this by
> only trying to merge it in if it is still a part of the tree. Thanks,
>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
> ---
> fs/btrfs/extent_map.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
> index ed88f5e..9759911 100644
> --- a/fs/btrfs/extent_map.c
> +++ b/fs/btrfs/extent_map.c
> @@ -289,7 +289,8 @@ out:
> void clear_em_logging(struct extent_map_tree *tree, struct extent_map *em)
> {
> clear_bit(EXTENT_FLAG_LOGGING, &em->flags);
> - try_merge_map(tree, em);
> + if (em->in_tree)
> + try_merge_map(tree, em);
> }
>
> /**
> --
> 1.7.7.6
>
> --
> 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
prev parent reply other threads:[~2013-01-29 2:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-28 14:52 [PATCH] Btrfs: do not merge logged extents if we've removed them from the tree Josef Bacik
2013-01-28 18:52 ` Zach Brown
2013-01-28 19:19 ` Josef Bacik
2013-01-28 19:20 ` Zach Brown
2013-01-29 2:31 ` Liu Bo [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=20130129023131.GC15654@liubo.jp.oracle.com \
--to=bo.li.liu@oracle.com \
--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