Btrfs: Make sure nodes have enough room for a double split
authorChris Mason <chris.mason@oracle.com>
Thu, 24 Apr 2008 13:22:51 +0000 (09:22 -0400)
committerChris Mason <chris.mason@oracle.com>
Thu, 25 Sep 2008 15:04:02 +0000 (11:04 -0400)
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/ctree.c

index 1c3d9d6fbdadfcaaf2328602ee48ecc4f0d48178..8ad8b5cc295ac3eb6144789161b95d56dae43aa6 100644 (file)
@@ -1146,7 +1146,7 @@ again:
                                slot -= 1;
                        p->slots[level] = slot;
                        if (ins_len > 0 && btrfs_header_nritems(b) >=
-                           BTRFS_NODEPTRS_PER_BLOCK(root) - 1) {
+                           BTRFS_NODEPTRS_PER_BLOCK(root) - 3) {
                                int sret = split_node(trans, root, p, level);
                                BUG_ON(sret > 0);
                                if (sret)