mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 22:51:42 +00:00
Btrfs: Fix split_leaf to avoid incorrect double splits
Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
ff190c0c00
commit
5ee78ac70f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user