提交 5ee78ac7 编写于 作者: C Chris Mason

Btrfs: Fix split_leaf to avoid incorrect double splits

Signed-off-by: NChris Mason <chris.mason@oracle.com>
上级 ff190c0c
......@@ -1865,7 +1865,11 @@ static int split_leaf(struct btrfs_trans_handle *trans, struct btrfs_root
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册