commit | 5ee78ac70f6c01f2a5acf662c2af975665710edc | [log] [tgz] |
---|---|---|
author | Chris Mason <chris.mason@oracle.com> | Fri Oct 19 14:01:21 2007 -0400 |
committer | Chris Mason <chris.mason@oracle.com> | Thu Sep 25 11:03:57 2008 -0400 |
tree | b6359b9df3d436a87853e84fed6a88fbb3aeb6d6 | |
parent | ff190c0c004d8e51195c7bcf5a8490aeefccbce0 [diff] [blame] |
Btrfs: Fix split_leaf to avoid incorrect double splits Signed-off-by: Chris Mason <chris.mason@oracle.com>
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index e846694..53e40b5 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c
@@ -1865,7 +1865,11 @@ return ret; } mid = slot; - double_split = 1; + if (mid != nritems && + leaf_space_used(l, mid, nritems - mid) + + space_needed > BTRFS_LEAF_DATA_SIZE(root)) { + double_split = 1; + } } } nritems = nritems - mid;