summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2009-09-24 10:00:58 -0400
committerChris Mason <chris.mason@oracle.com>2009-09-24 10:00:58 -0400
commit54bcf382daf08c1396edb8b81e650b58930ccaef (patch)
tree64b941f09489b5c9ee63e4ad43d736bfce911b21 /fs/btrfs/ctree.c
parent94a8d5caba74211ec76dac80fc6e2d5c391530df (diff)
parentc65ddb52dc412c9b67681b1aa16cd1bac8434e24 (diff)
downloadkernel-crypto-54bcf382daf08c1396edb8b81e650b58930ccaef.tar.gz
kernel-crypto-54bcf382daf08c1396edb8b81e650b58930ccaef.tar.xz
kernel-crypto-54bcf382daf08c1396edb8b81e650b58930ccaef.zip
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable into for-linus
Conflicts: fs/btrfs/super.c
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r--fs/btrfs/ctree.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 3fdcc0512d3..ec96f3a6d53 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -2853,6 +2853,12 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans,
int split;
int num_doubles = 0;
+ l = path->nodes[0];
+ slot = path->slots[0];
+ if (extend && data_size + btrfs_item_size_nr(l, slot) +
+ sizeof(struct btrfs_item) > BTRFS_LEAF_DATA_SIZE(root))
+ return -EOVERFLOW;
+
/* first try to make some room by pushing left and right */
if (data_size && ins_key->type != BTRFS_DIR_ITEM_KEY) {
wret = push_leaf_right(trans, root, path, data_size, 0);