diff options
author | Yan Zheng <zheng.yan@oracle.com> | 2009-06-27 21:07:35 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-07-02 13:41:17 -0400 |
commit | 2c47e605a91dde6b0514f689645e7ab336c8592a (patch) | |
tree | d541e61440f06f37d17e2d14cbaa78fc0cd41ff2 /fs/btrfs/relocation.c | |
parent | a970b0a16cc416a509d5ae8b1d70978664e6f4fe (diff) | |
download | kernel-crypto-2c47e605a91dde6b0514f689645e7ab336c8592a.tar.gz kernel-crypto-2c47e605a91dde6b0514f689645e7ab336c8592a.tar.xz kernel-crypto-2c47e605a91dde6b0514f689645e7ab336c8592a.zip |
Btrfs: update backrefs while dropping snapshot
The new backref format has restriction on type of backref item. If a tree
block isn't referenced by its owner tree, full backrefs must be used for the
pointers in it. When a tree block loses its owner tree's reference, backrefs
for the pointers in it should be updated to full backrefs. Current
btrfs_drop_snapshot misses the code that updates backrefs, so it's unsafe for
general use.
This patch adds backrefs update code to btrfs_drop_snapshot. It isn't a
problem in the restricted form btrfs_drop_snapshot is used today, but for
general snapshot deletion this update is required.
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/relocation.c')
-rw-r--r-- | fs/btrfs/relocation.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index b23dc209ae1..00839793477 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -1788,7 +1788,7 @@ static void merge_func(struct btrfs_work *work) btrfs_end_transaction(trans, root); } - btrfs_drop_dead_root(reloc_root); + btrfs_drop_snapshot(reloc_root, 0); if (atomic_dec_and_test(async->num_pending)) complete(async->done); @@ -2075,9 +2075,6 @@ static int do_relocation(struct btrfs_trans_handle *trans, ret = btrfs_drop_subtree(trans, root, eb, upper->eb); BUG_ON(ret); - - btrfs_tree_unlock(eb); - free_extent_buffer(eb); } if (!lowest) { btrfs_tree_unlock(upper->eb); |