linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Liu Bo <bo.li.liu@oracle.com>
To: linux-btrfs@vger.kernel.org
Cc: Marcel Ritter <ritter.marcel@gmail.com>,
	Christian Robert <christian.robert@polymtl.ca>,
	<alanqk@gmail.com>,
	Konstantinos Skarlatos <k.skarlatos@gmail.com>,
	David Sterba <dsterba@suse.cz>,
	Martin Steigerwald <Martin@lichtvoll.de>,
	Josef Bacik <jbacik@fb.com>, Chris Mason <clm@fb.com>
Subject: [PATCH v9 08/16] Btrfs: don't return space for dedup extent
Date: Wed,  9 Apr 2014 15:08:36 +0800	[thread overview]
Message-ID: <1397027325-27151-9-git-send-email-bo.li.liu@oracle.com> (raw)
In-Reply-To: <1397027325-27151-1-git-send-email-bo.li.liu@oracle.com>

If the ordered extent had an IOERR or something else went wrong we need to
return the space for this ordered extent back to the allocator, but if the
extent is marked as a dedup one, we don't free the space because we just
use the existing space instead of allocating new space.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
 fs/btrfs/inode.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index c69e530..d32b066 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -3213,6 +3213,7 @@ out:
 		 * truncated case if we didn't write out the extent at all.
 		 */
 		if ((ret || !logical_len) &&
+		    !ordered_extent->dedup &&
 		    !test_bit(BTRFS_ORDERED_NOCOW, &ordered_extent->flags) &&
 		    !test_bit(BTRFS_ORDERED_PREALLOC, &ordered_extent->flags))
 			btrfs_free_reserved_extent(root, ordered_extent->start,
-- 
1.8.2.1


  parent reply	other threads:[~2014-04-09  7:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-09  7:08 [RFC PATCH v9 00/16] Online(inband) data deduplication Liu Bo
2014-04-09  7:08 ` [PATCH v9 01/16] Btrfs: disable qgroups accounting when quata_enable is 0 Liu Bo
2014-04-09  8:57   ` Liu Bo
2014-04-09  7:08 ` [PATCH v9 02/16] Btrfs: introduce dedup tree and relatives Liu Bo
2014-04-09  7:08 ` [PATCH v9 03/16] Btrfs: introduce dedup tree operations Liu Bo
2014-04-09  7:08 ` [PATCH v9 04/16] Btrfs: introduce dedup state Liu Bo
2014-04-09  7:08 ` [PATCH v9 05/16] Btrfs: make ordered extent aware of dedup Liu Bo
2014-04-09  7:08 ` [PATCH v9 06/16] Btrfs: online(inband) data dedup Liu Bo
2014-04-09  7:08 ` [PATCH v9 07/16] Btrfs: skip dedup reference during backref walking Liu Bo
2014-04-09  7:08 ` Liu Bo [this message]
2014-04-09  7:08 ` [PATCH v9 09/16] Btrfs: add ioctl of dedup control Liu Bo
2014-04-09  7:08 ` [PATCH v9 10/16] Btrfs: improve the delayed refs process in rm case Liu Bo
2014-04-09  7:08 ` [PATCH v9 11/16] Btrfs: fix a crash of dedup ref Liu Bo
2014-04-09  7:08 ` [PATCH v9 12/16] Btrfs: fix deadlock of dedup work Liu Bo
2014-04-09  7:08 ` [PATCH v9 13/16] Btrfs: fix transactin abortion in __btrfs_free_extent Liu Bo
2014-04-09  7:08 ` [PATCH v9 14/16] Btrfs: fix wrong pinned bytes " Liu Bo
2014-04-09  7:08 ` [PATCH v9 15/16] Btrfs: use total_bytes instead of bytes_used for global_rsv Liu Bo
2014-04-09  7:08 ` [PATCH v9 16/16] Btrfs: fix dedup enospc problem Liu Bo
2014-04-09  7:08 ` [PATCH v4] Btrfs-progs: add dedup subcommand Liu Bo
2014-04-09 10:10   ` [PATCH v5] " Liu Bo
2014-04-09 10:14     ` Liu Bo

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=1397027325-27151-9-git-send-email-bo.li.liu@oracle.com \
    --to=bo.li.liu@oracle.com \
    --cc=Martin@lichtvoll.de \
    --cc=alanqk@gmail.com \
    --cc=christian.robert@polymtl.ca \
    --cc=clm@fb.com \
    --cc=dsterba@suse.cz \
    --cc=jbacik@fb.com \
    --cc=k.skarlatos@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=ritter.marcel@gmail.com \
    /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).