summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Mason <chris.mason@fusionio.com>2012-08-07 15:34:49 -0400
committerChris Mason <chris.mason@oracle.com>2012-08-28 16:53:34 -0400
commitb12a3b1ea209d9dec02731fba58c3dbe7d31cfd8 (patch)
tree9e4a1e663a040b5b8af6b266bcb53a6a7fba437f
parent6fc823b10f333313deb0b5d9069cbfd3a3f99f3a (diff)
downloadlinux-3.10-b12a3b1ea209d9dec02731fba58c3dbe7d31cfd8.tar.gz
linux-3.10-b12a3b1ea209d9dec02731fba58c3dbe7d31cfd8.tar.bz2
linux-3.10-b12a3b1ea209d9dec02731fba58c3dbe7d31cfd8.zip
Btrfs: don't run __tree_mod_log_free_eb on leaves
When we split a leaf, we may end up inserting a new root on top of that leaf. The reflog code was incorrectly assuming the old root was always a node. This makes sure we skip over leaves. Signed-off-by: Chris Mason <chris.mason@fusionio.com>
-rw-r--r--fs/btrfs/ctree.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 08e0b11ba0a..6d183f60d63 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -625,6 +625,9 @@ __tree_mod_log_free_eb(struct btrfs_fs_info *fs_info, struct extent_buffer *eb)
u32 nritems;
int ret;
+ if (btrfs_header_level(eb) == 0)
+ return;
+
nritems = btrfs_header_nritems(eb);
for (i = nritems - 1; i >= 0; i--) {
ret = tree_mod_log_insert_key_locked(fs_info, eb, i,