Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1514794e authored by Chris Mason's avatar Chris Mason
Browse files

Btrfs: Make sure nodes have enough room for a double split

parent bcbfce8a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1146,7 +1146,7 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root
				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)